ServerTune

Browse by category

Search    |    Advanced search

Php scripts returning errors when using: php_flag and php_value

You have added php_flag and/or php_value directives in your .htaccess file and your Php scripts used to work just fine. Now, your scripts do not work, what's the problem? Looking into your log /usr/local/apache/error_log file, you see the following errors:

Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration
OR

Invalid command 'php_value, perhaps mis-spelled or defined by a module not included in the server configuration

Reason:

The script you are using assumes that Php is installed as a module. It is likely that Php is installed as a CGI on your server(s). Your script should have documentation for how to install it on servers that run Php as a CGI. This is sometimes referred to as Phpsuexec or SuPhp.

For more information o how to use php_value directives in .htaccess files with suPhp, go to: SuPhp FAQ
OR Click here to browse SuPhp mailing list.

SolutionInstead of adding these directives to your .htaccess file, add them into a file called php.ini and place this file in the same directory that your script runs in. Most often this will be public_html directory, but in some cases you will install your script in a subdirectory. Wherever your script runs, this is the place for your php.ini file. You will need to drop the "php_flag" and "php_value" prefix. You will also need to put an equals (=) sign between the setting and the value.

For example, if your script recommends these settings in a .htaccess file:

php_value upload_max_filesize 10M
php_value post_max_size 10
php_value max_execution_time 60

Put these directives in a php.ini file instead. Here is the proper syntax:

upload_max_filesize = 10M
post_max_size = 10M
max_execution_time = 60

If none of the above helps, contact our Customer Service at: customerservice@servertune.com and we'll be more than happy to work with you.

 
 
Add comment
 
Views: 1245
 
Votes: 0
 
Comments: 0
 

Other articles in this Category

RSS