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

Pre-Requsities

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: 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. 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. http://server-ip/phpinfo.php

How to Create and Access phpinfo   File   TecAdmin - 5