Issue :

When trying to turn ‘register_globals’ ON by adding a statement “php_flag register_globals on ” in the .htaccess, following error appears on the website:
“A 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request”
Apache error log says:
.htaccess: Invalid command ‘php_flag’, perhaps mis-spelled or defined by a module not included in the server configuration

Solution :

Basically the error message occurs because of suPHP being enabled on the server due to which you can’t define the php values in .htaccess file. But you can manage php values by using a custom php.ini in each directory where you want the changes to take effect.

For example, if you want to enable the register_globals for the domain name ‘’ , then you need to create a ‘php.ini’ file under the public_html folder with the content “register_globals = On”. It will enable the register_globals for that particular folder.

Contact Us On WhatsApp