How to view PHP settings with the phpinfo() function

This article describes how to use the phpinfo() function to view detailed information about the PHP environment, settings, and more.

To view phpinfo() output on our servers, you must have an A2 Hosting account. The information revealed by the phpinfo() function poses a potential security risk, so we do not post it publicly. Hackers and other malicious actors could use the information from phpinfo() to plan an attack.

View PHP settings with phpinfo Function

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:

  1. Create a file that contains the following code:
  2. Save the file as info.php or something similar.
  3. Upload the file to your public_html directory.
  4. Use your browser to go to, where represents your web site's domain name. The page displays a large amount of information about the PHP installation.

    For security reasons, you should disable any calls to the phpinfo() function when web site development and testing is complete.

More Information

For more information about the phpinfo() function, please visit

PHP Hosting

Article Details

  • Level: Intermediate

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.