We just got a new server on HostGator, and upon accessing some php files we had uploaded, we got this error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@domain.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I looked at the server logs in /usr/local/apache/logs/error_log to see:

[Mon Mar 25 16:28:50 2013] [error] [client 76.195.176.118] SoftException in Application.cpp:256: File “/home/user1/public_html/folder1/index.php” is writeable by group

[Tue Mar 26 09:05:26 2013] [error] [client 76.195.176.118] SoftException in Application.cpp:601: Directory “/home/user1/public_html/folder1″ is writeable by group

Turns out, this error can be caused by suEXEC, a security feature that checks permissions of files before running them to make sure there are no vulnerabilities. You can turn it off in WHM under the Service Configuration area, “Configure PHP and suEXEC”

To fix this error:

Run these 2 commands. This will adjust the permissions of php files and directories if they had been set incorrectly.

find . -name ‘*.php’ | xargs chmod 644
find . -type d | xargs chmod 755

To prevent this error:

To stop this from ever happening in the future, you have to adjust the umask of the user. Umask sets the default permissions on any new files. Just type ‘umask 0022’ at the command line while you’re that user. HostGator originally has it set at 0002.

Good luck, let me know if that fixes your problem!

About Shane
Shane is the creator of Page Speed Analytics tool MachMetrics. You can follow his entrepreneurial activities on his blog SideProjectProfit

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

   
© 2012 ShaneLabs Suffusion theme by Sayontan Sinha