There may be times you need to view your account's php settings. In order to do that you will want to create a phpinfo page. If you need to update any of your php variables, please see our article on updating your local PHP settings.
Creating a phpinfo page:
In this walk through we will use the cPanel File Manager to create our phpinfo page.
- Start by logging into your cPanel
- Open File Manager
- Make sure you are in the directory you want to put the phpinfo page into. For instance, if you are making a phpinfo page for your main domain name, you will want to be in the public_html directory. If you're creating a phpinfo page for an Addon domain, navigate to public_html/addondomain.com
- Click on the "New File" File icon at the top of the page
- In the dialog box that appears asking you for a file name, type in phpinfo.php. Note: this file can actually be named anything you want it to be, phpinfo is just the most common name for this file)
- Locate your new phpinfo file, right click it and select either "Edit" or "Code Edit" from the menu. If a "Text Editor" prompt appears, in the drop down list, choose "utf-8" and then click the "Edit" button.
- In the editor, type in the following text:
<? phpinfo(); ?>
- Click the "Save Changes" button.
That's all there is to creating a phpinfo.php file.
Viewing Your phpinfo Page
To view your newly created phpinfo page simply navigate to YourDomain.com/phpinfo.php. You should see a page similar to:
If you need to see a specific value for a setting, use your browser's search feature (Ctrl + F in Windows or Command + F for Mac). For instance, if I wanted to find the memory_limit setting, I would search for memory_limit setting. The first column shows the local value and the second column shows the master value. The local value overrides the master value so it is the one to look at and determine if you need to make any changes to.
It's important to understand that the phpinfo file shows your individual php settings. Because phpinfo.php is a common file name, there are potentially malicious "bots" on the web that will search for that file name. It's best practice to do one of the following when you are finished
- Delete the file
- Rename it to something hard for other to guess
(Keep in mind that it may be difficult for you to remember that filename)
- Move the file above public_html