Posts Tagged ‘suphp’

Correct Permission Problem In Suphp

Tuesday, November 3rd, 2009

With Suphp, you can’t have any files or folders with permissions greater than 755. Otherwise, you will get a Internal Server Error. There could be other reasons for that error. You must check the apache error_log. In Centos, you will find that file in /usr/local/apache/logs/error_log.

Confirmed the permission problem, a easy fix is to ssh to the server. Access the public_html folder of the account. And run these commands:

find . -type f -exec chmod 644 '{}' \;
find . -type d -exec chmod 755 '{}' \;

If you don’t have ssh access to your shared hosting account, upload a php file to the public_html directory and call the file in the browser. Include this code in the php file:

<?
shell_exec("find . -type d -exec chmod 755 {} \\;");
shell_exec("find . -type f -name '*.php' -exec chmod 644 {} \\;");
?>