phpinfo function output

The phpinfo() is the core function of PHP. It prints detailed information about the current stat and configuration of PHP on server. With the help of phpinfo, you can find the PHP version, modules and there version and configuration options.

This tutorial will help you to create a php script with phpinfo() function and access it.


We assume you already have installed PHP and a Web server on your system.

Create File with PHPINFO()

You need to find default ducument root of your Web server. Also, you can use document root of any domain configured with the web server and pointed to it.

In my case, I create a php script at below location:

sudo vim /var/www/html/phpinfo.php

Add below content to the file:

Save your file and close it.

Next, you need to set proper permissions on your file to be accessible by your web server.

sudo chmod 755 /var/www/html/phpinfo.php
sudo chown www-data:www-data /var/www/html/phpinfo.php

Change www-data with the username of your web server running with.

Access PHPINFO() Script

Your phpinfo script is ready to access. You can access above created file in a web brower with your server ip address or configured domain name.


Createing phpinfo() function script
Output of phpinfo() function

The post How to Create and Access phpinfo() File appeared first on TecAdmin.