» What's the deal with php_value, php_admin_flag, etc

I ran accross php value, php flag, php admin value and php admin flag in a couple of .htaccess files, and I've used them sometimes as well by just pasting an example, but I've never really understood why there was such a great diversity. Couldn't php_setting X Y just handle it, and if not, what do the admin, value and flag attributes mean?

explained

So one time when I had nothing to do I figured let's end the doubts once and for all, lets google :) And here's what I found:

  • php_value name value
    Sets the value of the specified directive. Can be used only with PHP_INI_ALL and PHP_INI_PERDIR type directives. To clear a previously set value use none as the value. Note: Don't use php_value to set boolean values. php_flag (see below) should be used instead.
  • php_flag name on|off
    Used to set a boolean configuration directive. Can be used only with PHP_INI_ALL and PHP_INI_PERDIR type directives.
  • php_admin_value name value
    Sets the value of the specified directive. This can not be used in .htaccess files. Any directive type set with php_admin_value can not be overridden by .htaccess or virtualhost directives. To clear a previously set value use none as the value.
  • php_admin_flag name on|off
    Used to set a boolean configuration directive. This can not be used in .htaccess files. Any directive type set with php_admin_flag can not be overridden by .htaccess or virtualhost directives.

more

Source: www.php.net/manual/en/configuration.changes.php

You probably shouldn't follow me


Like this Article?

I'd appreciate it if you leave a comment, spread the word, or consider a small donation


tags: php, htaccess, virtual host, apache
category: Howto - Webserver
read: 13,763 times

Add comment

(required, shown)(required, not shown)for syntax highlighting

[CODE="Javascript"]
your_code_here();
[/CODE]

Replace "Javascript"
with "php", "text", etc.
code (to make sure you are not a spammer)

 Track replies: rss feed comments feed

Comments

#2. Kevin on 25 February 2009

Twitter.com: kvz@ txyoji: This is not true when you are in a protected hosting environment.

#1. txyoji on 24 February 2009

Gravatar.com: txyojiAny value of type PHP_INI_ALL can be overriden on the page with

ini_set('Attrib','NewValue');

Even if it was set with a php_admin_value or flag.