In our shared hosting environment, the server PHP is running in suPHP mode for security and remove the PHP safe-mode restriction.

If you install a new PHP application, remember to set –
1. All PHP are of (max) permission 644
2. All directories (and its sub-directories) of (max) permission 755
such that your PHP can run fine.

The file or folder permission cannot be 777. Otherwise you may encounter – “Internal Server Error”

You may simply create a fixpermission.php file in your PHP application folder with the following content –

passthru( “find -type d | xargs chmod 755” );
passthru( “find -iname ‘*.php’ | xargs chmod 644 ” );
echo “Done”;

and then use

After execution, remember to delete this fixpermission.php

Then it should be ok.

Note: as the PHP runs in suPHP mode, it does not support php_flag/php_value directive in this mode.

suPHP v.s. Apache Handler for PHP:

Pin It on Pinterest

Share This