Home > Cpanel Basics > Common Problems experienced with PHPSuphp

Common Problems experienced with PHPSuphp

July 23rd, 2010

If your PHP scripts are reporting 500 Internal Server errors, please check the following:

Make sure the directory permissions are not greater than 755

Make sure the PHP file permissions are not greater than 755 - 644 is the default permissions for files uploaded by FTP and will work fine for most PHP files.

Make sure you do not have any .htaccess files which contain PHP flags/values or ForceType directives. These directives need to be handled differently, as explained above.


How to find and change existing users files permissions or ownerships to meet PHPSuexec or SuPHP guidelines ?

Set owner of all user files
Also you can run the following to ensure all users files are correctly owned.
You can do this running the following commands in shell as root;

for CPAccess in `ls -A /var/cpanel/users`; do chown -R $CPAccess:$CPAccess /home/$CPAccess/public_html; done

for CPAccess in `ls -A /var/cpanel/users`; do chown $CPAccess:nobody /home/$CPAccess/public_html; done

Set permissions of all user files

find /home*/*/public_html -type d -perm 0777 -exec chmod 755 {} \;
find /home*/*/public_html -type f -perm 0666 -exec chmod 644 {} \;

Cpanel Basics

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.