ServerTune Logo Dedicated Servers Colocation VPS Server Management ServerTune.com
 
ServerTune HomeAbout usContact usHelp DeskKnowledgebaseSpecialLIVE Chat ServerTune
DirectAdmin VPS Server Management

Value, Power, and Performance :: Dedicated Servers starting $89 /month

Dedicated Server Hosting

Click here to view photos from the conferences we attended.   *** Follow ServerTune on: ServerTune is on Facebook ServerTune is on Twitter
 
Browse by category   Search
 


Php scripts returning errors when using: php_flag and php_value
Printer Friendly
email to a friend
Email to friend
Add comment Add comment
Views: 4705
Votes: 0
Comments: 0
Posted: 23 Nov, 2007
by: Customer Service :: S.
* * * * *
Updated: 14 Dec, 2009
by: Customer Service :: S.
SymptomYou 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

 

ReasonThe 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: http://www.suphp.org/FAQ.html
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.

Other articles in this Category
document HowTo: Tweak php for maximum execution time for scripts
document HowTo :: Install and configure FFmpeg and FFpeg-Php
document Call to unsupported or undefined function mysql_connect
document FFmpeg :: make: *** [libavcodec/imgresample.o] Error 1
document FFmpeg :: headers not found. Make sure you've built ffmpeg as shared libs
document Fatal error: Allowed memory size of 22468 bytes exhausted (tried to allocate 446810 bytes) in /path/file.php
document FFmpeg :: libamrnb.so.2: cannot open shared object file: No such file or directory
document HowTo secure your vBulletin Forum
document FFmpeg :: make: *** [ffmpeg_frame.lo] Error 1



RSS

Control Panel Licensing
cPanel Plesk Miva Merchant