I was stumbled across this error tonight and was wondering how it happened to be. After checking and researching a lot got to know that we have enabled PHPsuexec or suPHP. It was enabled to avoid scripts running with nobody user and to stop scripts running with 777 permissions; it is good as far as security is concerned but however most of the scripts of the client broke with "500 internal server error"
[Mon Apr 28 13:15:42 2009] [alert] [client xx.xx.xx.xx] /home/rzcl/public_html/.htaccess: Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration
[Mon Apr 28 13:17:40 2008] [alert] [client xx.xx.xx.xx] /home/rzcl/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
Error was because there was either php_flag or php_value in .htaccess file. After enabling PHPsuexec; these options are no more recognized by server. Hence, the error.
Solution:
Create a php.ini file in the directory where the special PHP options are required. For example, normally for security reasons register_globals is turned off on the server but you can enable it for your domain by adding the below line
php_flag register_globals on
But after PHPsuexec is enabled this function would not work and would give "500 internal server error". Hence, create a php.ini file with the following line
register_globals=1
However, the important point to remember in this regard is that php.ini does not work as .htaccess file. Any thing .htaccess file effects the directory and the sub-directories but php.ini does not work this way. You will have to place php.ini in every directories and sub-directories that require the php options.
No comments:
Post a Comment