What is phpinfo(); ?

What is phpinfo(); ?

Phpinfo() :

Phpinfo() function contains the information about configuration setting and availability of variables on the system. The phpinfo() function also contains the information about state of PHP that includes:

· Extensions and PHP compilations

· Server information

· Upgraded PHP versions

· Environment of PHP

· Operating System Version

· Headers of HTTP

· PHP License

· Local or master configuration option

· Paths

Phpinfo() is a debugging tools that have all Enviornment.GET,POST,Cookie,Server [EGPCS] data. You can also get the php information by using the server command line. You can also get the information on the browser.

Method 1:

To get php information on browser you have to create a phpinfo.php file below the public folder on your website. Add the following code into your .php file

<? Php phpinfo(); ?>

Method 2:

To get the php information by server command line using this simple command

Php-r ‘phpinfo();’

How to create a phpinfo.php page:

i. For create a phpinfo file you need to open a new file and write the given code and save it by phpinfo.php extension.

<? Php



ii. After that upload file. You should know that you have to upload your file in exact directory for test. You should be use FTP to upload file.

iii. If you upload your file successfully then visit http://www.example.com/phpinfo.php with you own domain name.

iv. Then see all the information about php for your server.

How to disable phpinfo() function in Shared Environment:

To disable phpinfo() function simply adding a line disable_function into php.ini file on server.

Follow the two simple steps to disable function in shared environment

Method 1:

SSH to server as root.

Editing the php.ini file by adding the line

Disable_functions = phpinfo

Method 2:

For .htaccess you can simply adding a line

Php_value disable_function phpinfo
First release
Last update
0.00 star(s) 0 ratings