Where does phpinfo () get information?

If you run phpinfo(); , it will show exactly what is in php.ini, or if the parameters are changed on the fly through php using methods like ini_set() or via .htaccess , will they be displayed in phpinfo?

+6
php phpinfo
source share
5 answers

phpinfo() shows the current configuration in the Local Value column; those.

  • what is in php.ini
  • end up overriding apache VirtualHost or .htaccess
  • ultimately redefined by ini_set

At the end, it shows the configuration values ​​that your script will / will use.


As a side element: it also displays information that is not really a “configuration”, for example, the configure line that was used to compile PHP, the version of Zend Engine, ...

+7
source share

Shows the current working environment, and not just what is in php.ini. Everything that changes the environment will be reflected, like the methods you mentioned.

+1
source share

I think that the meaning of "global" and "local" columns is "global" is what is set in the central php.ini, "local" is any changes that have been applied to global parameters using one of the methods that you describe.

0
source share

If you use ini_set() , the changes are made "on the fly" only for the current script, it does not permanently change the php.ini settings. phpinfo() shows the current settings of what is in the php.ini , which is also affected by the apache and ini_set functions.

0
source share

phpinfo() always displays the setting value in 2 columns. The first column is the global value set in the php.ini . The second column for each user value set in php.ini can either be overridden by the .htaccess file or redefined via ini_set before calling phpinfo() .

Please note that not all settings can be overridden by .htaccess or ini_set . See the full list here and look at the column Changeable. See Explanation of the value of the column Changeable here .

Try it yourself.

0
source share

All Articles