How to create a PHP info page

Categories

How to create a PHP info page

You are here:

 

Introduction

This guide details how to create and the usage of a php info file.

What is a PHP info file?

A php info is a file that is very easy to set up that provides a lot of information about the host and the version on php that it is running. It will include things like the version of PHP being used, configuration files, modules being used, and max request sizes.

 

How to create a PHP info file

To follow this article, you must already have a HTTP(s) server setup (like Nginx or Apache) and configured to execute PHP files.

1) Navigate to the webroute of your HTTP(s) server. This is the folder that is highest up in the tree that your HTTP server will server files from. For this article we will use the default Nginx webroot

/usr/share/nginx/html

cd /usr/share/nginx/html

2)  Create a file using touch called phpinfo.php

touch phpinfo.php

3) Open the phpinfo.php file using your text editor of choice. Nano is a good choice and is installed by default on most systems. Add the following text

<?php
phpinfo();
?>

4) Save the change to the file

5) Navigate to

my_server_ip/phpinfo.php

and you should see something similar to this:

The first table list various bits of information about the php install. The subsequent tables list the configuration for each of the included PHP modules.

Table of Contents