STS Host and Tech Knowledge base
Search
Close this search box.

How to Create phpinfo File and Check PHP Information

In this article, we’ll show you how to create a phpinfo file. Also how to check its detailed information. For example, you might want to check whether your PHP configurations meet the requirements of any software you want to run on your server.

What is phpinfo?

phpinfo() is a function or a code snippet to determine the website’s PHP configuration. Here is some information that the PHP function displays after running phpinfo():

  • A version of PHP the website is currently using.
  • Server information and environment.
  • Operating System version information.
  • The PHP environment.
  • HTTP headers.
  • Modules and extensions.
  • Master and local values.
  • Paths along with php.ini location.
  • The PHP License.

How To Create And Use a phpinfo File?

You often need to check PHP settings during web development. You can do this by running a script that calls the phpinfo() function. When you load the page in a web browser, the script shows all of the PHP configuration settings for your web site.

To use the phpinfo() function to view PHP settings:

  • Login to cPanel.
  • Navigate to File Manager under the Files section.
file manager
  • Once you’re in public_html directory, click the New File button.
phpinfo file
  • Name your file phpinfo.php and press Create.
create phpinfo file
  • Scroll down and locate the new phpinfo file within the directory, then right-click to Edit.
  • After that, copy and paste the following code and press Save.
				
					<?php
    phpinfo();
?>
				
			
  • Use your browser to go to http://test.com/phpinfo.php. where test.com represents your web site’s domain name. The page displays a large amount of information about the PHP installation.

Share Article

Related Articles