How to Create a phpinfo Page to View Your PHP Settings

In this guide, we’ll show you how to create a phpinfo page to view the current PHP settings for your php host. PHP has many environmental variables that you are able to update as needed. For example, you may need to update your php memory_limit to prevent certain scripts from running out of memory.

Before you change these values, you must first be able to see what they are. To do that, you will need to create a phpinfo page. A phpinfo page shows you all of your php environment settings.

A phpinfo page is simply a page with the following PHP code:

<? phpinfo(); ?>
Don’t have time to read the guide? Check out our walk-through video.

Go Unlimited with Exceptional Shared Hosting

Upgrade your Shared Hosting today and take your business to the next level! Get unlimited NVMe SSD storage, cPanel, professional email and over $400 in savings.

check markFree Domain check mark24/7 Human Support check mark100% Money-Back Guarantee

Shared Hosting

How to Create a phpinfo Page

If you’re not familiar with how to create a php page, follow the steps below to create a phpinfo page using your File Manager. You can also use an FTP program if you prefer.

  1. Log into your cPanel.
  2. In the Files section of your cPanel, open the File Manager option.
  3. Navigate to the directory you are working with. This is important because each folder can actually be set to have different PHP settings. In this example, we are viewing the PHP settings for our main domain, so we are navigating to the “public_html” folder.
  4. In the top menu, click +File option to create a new file.
  5. When prompted for the file name, enter phpinfo.php (it can actually be named anything, phpinfo.php is simply a common name for the file).
  6. Find the phpinfo.php file in your list of files (it should have automatically updated). Right-click on it and choose Edit. If you see a “Text Editor” prompt, choose “utf-8” from the drop-down list and then click Edit.
  7. Enter the following code into the phpinfo.php file.
    <? phpinfo(); ?>
  8. Then click Save Changes.

How to View your PHP Settings

Now that you have created the phpinfo page, we’ll show you how to access it and view your PHP settings.

  1. You can now access this page from your browser. If you created the file in your public_html folder, then you would visit Be sure to replace with your actual domain name. The results should look similar to the below screenshot:
    Create phpinfo Page
  2. To find the specific value of a setting, search the page for what you’re looking for. In this case, we used our browser’s search feature (Ctrl + f) and searched for memory_limit. The first value you see is what is set for the current directory (local value), and the setting value is the master value. The local value is the actual setting and is the important value, because the local values will override the master value:
    Viewing a PHP Setting

Now you know how to create a phpinfo page and view your PHP settings. If you need to change any of these values, here are some helpful guides.

Check out our Website Tutorials section for more helpful guides to help you build a successful site.

InMotion Hosting Contributor
InMotion Hosting Contributor Content Writer

InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!

More Articles by InMotion Hosting

22 thoughts on “How to Create a phpinfo Page to View Your PHP Settings

  1. hello sir

    hopeing you could solve my problem

    i want to host a webpage using aws in phpcode.I actully mean tat on typing “” i shuld get phpinfo page as i did the folling to make my task happen :

    installed http using  source code and configured to my required location

    configured php 5.6 to my location and also make and installed bothe the services

    and in conf file of http i gave the code in virtualhost ald in htdocs i gave the code for phpinfo();

    also in /etc/hosts in localhost i mentioned my ip and link address as said above …

    bt thw problem is the page prints only as “it works ” can you please solve my problem

  2. hi sir im trying to install prestashop through godaddy cpanel getting following errors


    php-session ON (detected: OFF)
    php-fileinfo 1- (detected: OFF)
    php-gd 1- (detected: OFF)
    php-mcrypt 1- (detected: OFF)
    php-soap 1- (detected: OFF)
    php-dom 1- (detected: OFF)


    how to turn these on on webserver. pls guide me i have zero knoweldge about this.



    1. Those are PHP modules, You can install these under the EasyApache configuration in your WHM, If you do not have WHM access you will need to contact your host to see if they can install these for you.

  3. <? phpinfo(); ?>

    This is the syntax I used for complete success the first time around. without the extra “php” in front. Just as described in the information.

  4. Hi.

    When I try to go to the phpinfo.php page, I get the (HTTP 500) error. The file was already created with <?php phpinfo(); ?> in it and the permissions is at 0644.


    1. Hello Marcel,

      Make sure that your spacing is correct. If it’s not correctly spaced then it will not work. Permissions are okay. You can’t create a second one if it already exists.

      If you have any further questions or comments, please let us know.

      Arnel C.

  5. Excellent article. It worked fine and appears to have the problems I was having with Word Press. Keep up the great work!

  6. If i put the code as “<? phpinfo(); ?>”, and browse, it returns blank page.

    But if i put the code as “<?php phpinfo(); ?>”, then it retuns php information in result.

    1. Hello Jafar,

      Yes, the shortcut tags are being deprecated. It is always best to use <?php ?> when working with php code.

      Kindest Regards,
      Scott M

  7. I want to upgrade php on specific folder in my server, i have diffrent websites and dont want to upgrade php for all websites. will it work perfect on specific folder in my server without disturbing the other websites?

    I have nerver tried it before, so afrid if it effect on other folders as well 🙁

    1. Hello Rehana,

      As long as the server you are on has multiple versions of PHP installed you can use the .htaccess file to change the version for the folder it resides in. To do this you would use the following code in your .htaccess file:

      AddHandler application/x-httpd-php54 .php

      Where php54 is PHP version 5.4.

      Best Regards,
      TJ Edens

  8. DEar all.


    I have  a problems with my current hosting contract because it is not possible to connect to paypal sandbox environment since paypal has recently changed the protocols .Right now, TLSv1.2 and http 1.1 are required.

    The limitations of my current hosting is that the curl version is 7.20 and we need to have 7.34 and above.

    Please, could you tell me the overall php characteristivs provided by phpoinfo(). What is the culr version ?


    It is very important for us because we are looking for a new hosting service.

    1. All of the printed data available in the phpinfo file are too numerous to list here. I recommend checking the official PHP documentation if you need more information. If you have a VPS account with us we can work with you to get cURL to whatever specifications you require.

    1. Hello Gig,

      We would need more information about what you’re doing in order to determine how to help you. If you’re following the directions in the article above, the phpinfo page will appear.


  9. Excellent video! Thank you; this gave me the exact instructions that I needed to configure my site!


  10. Hello, 

    Please let me know how can i check that Email service is enabled or not in my server. I have print phpinfo() function and it show whole detail LIKE- sendmail_from, sendmail_path.

    But how i know my email service is working or not ? 


    1. Hello Vijay,

      The phpinfo would not inform you if the email service is working, for that please contact your hosts technical department to have them check the mail logs to be sure the service is working.

      Best Regards,
      TJ Edens

Was this article helpful? Join the conversation!

Leap into Savings
Leap Ahead with Limited Time Deals