WordPress / Web Development Tutorials
(Best WordPress Tutorials)

CSSHTMLJavaScriptjQueryMySQLPHPSilvaTechnologiesWooCommerceWordpress
Silva Web Designs - Blog

How to create a PHP info page

You can use a phpinfo() page to view the current PHP information for your server.

This file outputs a large amount of information, such as:

  • Information about PHP compilation options and extensions
  • PHP version
  • Server information and environment (if compiled as a module)
  • PHP environment
  • OS version information, paths, master and local values of configuration options
  • HTTP headers
  • PHP license

Because every system is set up differently, phpinfo() is commonly used to check PHP configuration settings and for available predefined variables on your particular system.

phpinfo() is also a valuable debugging tool, as it contains all EGPCS (Environment, GET, POST, Cookie, and Server) data.

Creating the file

To create a phpinfo file, open a plain text file, add the following lines, and save; Filename: phpinfo.php


<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>

Upload the file to the server. You should upload your file to the exact directory you want to test. Typically, this will be your httpdocs (/var/www/vhosts/example.com/httpdocs/) directory, although you can upload it to any subdirectory on your server as well. Use FTP to upload the file.

Visit the page in your browser. If you uploaded it to your html directory, you should now visit http://www.example.com/phpinfo.php, replacing example.com with your own domain name.

Now you can view all of the information about PHP for your server for that particular directory.

 

Nathan da Silva - Profile

Posted by: Nathan da Silva

Nathan is the Founder of Silva Web Designs. He is passionate about web development, website design and basically anything digital-related. His main expertise is with WordPress and various other CMS frameworks. If you need responsive design, SEO, speed optimisation or anything else in the world of digital, you can contact Silva Web Designs here; [email protected]

It’s good to share

Join the discussion

Related Posts

Related - How to Remove the ‘Default Sorting’ Dropdown in WooCommerce

WooCommerce / 2nd March 2025

How to Remove the ‘Default Sorting’ Dropdown in WooCommerce

Read More Related - How to find the full path to a file using PHP

PHP / 2nd March 2025

How to find the full path to a file using PHP

Read More