500 error when using php_value/php_flag

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 ‘test.com’ , 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.

Filed Under: Quick fixesTechnical

Tags:

About the Author: InstaCarma is a provider of Enterprise Class Solutions for the Hosting Industry

RSSComments (0)

Trackback URL

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes
InstaCarma provides outsourced web hosting technical support, helpdesk management, datacenter automation, cloud service management. Sales - 1800 810 6547 - visit www.instacarma.com