Welcome to UltratechHost Forum, Guest. Please take the time to register if you haven't, or click

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[-]
Tags
php scripts returning errors when using flag and value

Php scripts returning errors when using: php_flag and php_value
#1
Symptom

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.

========================

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



Dinesh Kumar Mohanty
Ultra Web Solutions®
Bhubaneswar, Odisha, India.

UltratechHost - Your One Stop Offshore & Onshore Hosting Provider
Server Locations : Netherlands, Germany, Russia, Singapore & USA
Service Offers: Shared hosting | Reseller hosting | Cloud server | Dedicated server | VPS Hosting



Forum Jump:


Users browsing this thread: 1 Guest(s)