.htaccess: Invalid command
I need temporarily put up an old page on the website. However, for that I need register_globals on. So i set .htaccess the following text:
-
php_value register_globals = 1
But what i got is error page 500. Go to error log and i found this:
-
[Apr 9 08:31:04 2008] [alert] [client xx.xxx.xx.xx] /home/xxx/public_html/.htaccess: Invalid command 'php_value', perhaps mis-spelled or defined by a module not included in the server configuration
-
[Apr 9 08:18:51 2008] [alert] [client xx.xxx.xx.xx] /home/xxx/public_html/.htaccess: Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration
As you can see, i got the same error for php_flag too. What am I missing?
Googling!! and hit, I'm feeling lucky!!
Yupz, i'm lucky enough and i found that my server now have PHPSUEXEC enabled.
What is PHPSuexec?
PHPSuexec is the shortened term often used to describe running PHP as a CGI with Suexec. Running PHP as a CGI with Suexec creates a much more secure environment compared to running PHP as an Apache module.
Thats why 'php_value/flag' no longer works. So the solution is create a php.ini file and set it like this:
-
register_globals=1
There is one main difference to the use of .htaccess vs php.ini -- a .htaccess file can be placed at the root directory and effect subdirectories with just 1 file, php.ini does not work this way.
A php.ini file needs to be placed in every directory and subdirectory that requires the altered directives. This is a downfall for using PHPSuexec, however i hope that in the future PHP can be written to handle the php.ini file in a more workable fashion.

ooooo...gitu tho...
* pur2 nyambung *
isn't that should be:
php_value register_globals 1
added for module checking it should be:
php_value register_globals 1
php_value register_globals 1
php_value register_globals 1
[IfModule mod_php4.c]
php_value register_globals 1
[/IfModule]
- its strip all tags
@ferdhie:
never try that way, as far as i know, if .htaccess contain php_value or php_flag with PHPSUEXEC enable, it will return error 500.
@ferdhie:
never try that way, but as far as i know, if .htaccess contain php_value or php_flag with PHPSUEXEC enable, it will return error 500.
Kayaknya bukan masalah apa2. Tergantung setting apache juga (httpd.conf ato apache.conf), settingan yang boleh dioverride apa aja (AllowOverride). Dulu aq pernah setting kayak itu juga buat nggedein php_upload_maxsize n post_maxsize, hasilnya nihil lewat .htaccess. Coz emang ternyata dari pihak hostingnya sendiri yang tidak memperbolehkan. Lewat fungsi ini_set() pun juga nggak mempan. Hack aja hostingnya
.