VPS
Main PagecPanel and DirectAdmin LicensingServer Management PlansVirtual Private ServersDedicated Servers
Control Panel Licensing
ServerTune ResellersResellersSpecial PromotionsServerTune SpecialsHomeAbout ServerTuneContact usTechnical SupportKB
ServerTune Main Page
Space
Space
Our most popular products:

SPECIAL PROMOTION: cPanel License $36 /month. more info

Issues, Tips, and Solutions

Protect your server with Mod Security rules written specifically for your system. more info ...

Space
Search:    Advanced search
Browse by category:
Php scripts returning errors when using: php_flag and php_value
Printer Friendly
email to a friend
Add comment Add comment
Views: 1994
Votes: 0
Comments: 0
Posted: 23 Nov, 2007
by: Support T.
* * * * *
Updated: 27 Aug, 2008
by: Support T.

-------------------- Problem --------------------
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: http://www.suphp.org/FAQ.html
OR Click here to browse SuPhp mailing list.

-------------------- Solution --------------------
Instead 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, submit a technical support request at: http://servertune.com/tickets/ 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 :: FFmpeg and FFpeg-Php
document Call to unsupported or undefined function mysql_connect
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



RSS