Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does phpinfo() get its info?

Tags:

php

If you run a phpinfo(); does it show exactly what is in the php.ini or if settings are changed on the fly via php with methods like ini_set() or via .htaccess will they be shown in phpinfo?

like image 654
JD Isaacks Avatar asked Feb 24 '10 16:02

JD Isaacks


People also ask

What is the use of Phpinfo () in PHP?

Because every system is setup differently, phpinfo() is commonly used to check configuration settings and for available predefined variables on a given system. phpinfo() is also a valuable debugging tool as it contains all EGPCS (Environment, GET, POST, Cookie, Server) data.

What is Phpinfo () function?

The phpinfo() function can be used to output a large amount of information about your PHP installation and can be used to identify installation and configuration problems. To run the function, just create a new file called test. php and place it into the root directory of your web server.

Where is PHP INI located?

ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits. This file is located on your server in the /public_html folder.


2 Answers

phpinfo() shows, in the "Local Value" column, the current configuration ; i.e.

  • what is in php.ini
  • eventually, overriden in Apache's VirtualHost or in .htaccess files
  • eventually, overriden by ini_set

In the end, it shows the configuration values that would be / are used by your script.


As a sidenote : it also display informations that are not-really "configuration" per-se, like the configure line that was used to compile PHP, the version of the Zend Engine, ...

like image 151
Pascal MARTIN Avatar answered Sep 17 '22 16:09

Pascal MARTIN


It will show the current running environment, not just what is in php.ini. Anything that changes the environment like the methods you mentioned will be reflected.

like image 26
David Pfeffer Avatar answered Sep 16 '22 16:09

David Pfeffer