Resolved PHP Post issue (500 - Internal Servor Error) and also issue w/ pwd protected directories

Status
Not open for further replies.

ocnetx10

New Member
Messages
8
Reaction score
2
Points
3
Question:

I had a basic PHP post form to relay contact and question information directly to an email address that was working for many years. As of recently it does not. Is this in relation to the site not using a security certificate and therefore this is not hashed/enciphered over an SSL connection and just sent as plaintext and the server rejecting it? Or is there a PHP configuration that I am missing.

The URL to the *.html form as well as the *.php script is below, as well as a screenshot of the socket response i receive after submitting any data. Again this worked in the past without issue and I only noticed it stopped working fairly recently.

Index Page of the form:
http://ocnetnetworks.x10.mx/ocnet_cadcam_eng_www/HOME/a4content/a4contact/index.htm

PHP Script invoked:
http://ocnetnetworks.x10.mx/ocnet_cadcam_eng_www/HOME/a4content/a4contact/submit.php

PHP-POST-SERVER-ERROR-2.png





2nd Question:

Additionally, I have some protected directories on this site which I use as a repository for some forms (boilerplate receipt and invoice forms and also a code repository so I can access it remotely. ) that was useful since I could access them or have others access them as needed when off site or even overseas, however now these same directories are no longer functioning. When a URL to the directory is followed, after entering the correct L/P credentials this exception is returned:

Forbidden
You don't have permission to access this resource.


I tried deleting/re-writing the /.htpasswd directory structure and .htpasswd files both manually via (s)FTP and via the control panel but to no avail. Any insight to what's going on would be welcoming. It's not really necessary for any of this data to be encrypted as this is non sensitive information.


Thanks all
 

ocnetx10

New Member
Messages
8
Reaction score
2
Points
3
P.S. Long time user of x10 but as you can see total newb on these forums, so if putting two questions in a single post is a violation of protocol:

Admins I apologize.
 

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
You should have more information in your error logs about the 500 errors. Log in to DirectAdmin and pull up what the root cause is. If you're using sockets, it could be that the firewall is blocking something that wasn't blocked before. Also check to make sure any IP addresses haven't changed since your server IP changed. If you're sending email, you may have to send it using x13.x10hosting.com instead of using your own domain, because SSL only works for the server, not for the user domains.

Check the permissions on your protected files and directories. Directories should be 755 (owner all permissions, everyone else read and enter) and files should be 644 (owner read/write, everyone else read only). If your directory has Options -Indexes, you'll get a forbidden error if you don't have an index.{html, htm, or php}. Turning Optoins +Indexes on will show the directory contents, which is not usually a concern on password protected folders.
 

ocnetx10

New Member
Messages
8
Reaction score
2
Points
3
You should have more information in your error logs about the 500 errors. Log in to DirectAdmin and pull up what the root cause is. If you're using sockets, it could be that the firewall is blocking something that wasn't blocked before. Also check to make sure any IP addresses haven't changed since your server IP changed. If you're sending email, you may have to send it using x13.x10hosting.com instead of using your own domain, because SSL only works for the server, not for the user domains.

Check the permissions on your protected files and directories. Directories should be 755 (owner all permissions, everyone else read and enter) and files should be 644 (owner read/write, everyone else read only). If your directory has Options -Indexes, you'll get a forbidden error if you don't have an index.{html, htm, or php}. Turning Optoins +Indexes on will show the directory contents, which is not usually a concern on password protected folders.


Still working on the first issue, but DUDE. thanks. Pwd protected directory problem was Issue with the *.htaccess file. accidentally removed the directory listing (indexes) flag when I was adding other cutesy things.

Thanks again.
 

ocnetx10

New Member
Messages
8
Reaction score
2
Points
3
K, Fixed first issue.

And no I wasn't using sockets, It was just a few functions to format and parse some form fields from the html referrer and some SPAM check functionality and pass the contents along to an email address.

parsed error log line:
" Fatal error: Uncaught Error: Call to undefined function eregi()"

Turns out "eregi()" is a function that's been removed in PHP7 and deprecated since v5.xx. Have to rewrite some code. In the mean time i'll just revert to 5.7 as this is one of the only implementations of PHP on this site and it will work for the time being. Currently in the progress of updating everything. There's a lot on there that's been deprecated and not updated in a very long time. I haven't had the time to do so until recently (Quarantine). Going to bring this all up to date and upgrade to a premium account.

Thanks for your help, have a good one.
 

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
Going to bring this all up to date and upgrade to a premium account.

If you do end up going to a premium account, make sure you put your free account information into the signup so it can be transferred by the support staff. If you see any issues, fill out a ticket in the client area at https://clients.x10premium.com since they have a dedicated ticket system and staff that we don't have here in free.
 
Status
Not open for further replies.
Top