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 –

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

and then use http://www.YourDomain.com/YourDirectory/fixpermission.php

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.

Links:
suPHP v.s. Apache Handler for PHP: http://www.empoweringmedia.com/blog/suphp-vs-mod_php-when-is-suphp-superior

Pin It on Pinterest

Share This