Free migrationUK web hosting from £2.99 a month, with backups every six hours and a 60-day money-back guarantee.UK web hosting from £2.99 a month.See hosting plans

How to create a phpinfo page

On this page

This guide shows how to make a small PHP file that lists every PHP setting your site is running with. It’s useful when a plugin or script says a setting is wrong and you want to see the real value.

What a phpinfo page is

PHP has a built-in function called phpinfo() that prints a long table of its own configuration. Put it in a file on your site, open that file in a browser, and you see the PHP version, memory limit, upload limits, loaded extensions and more, exactly as they apply to that folder.

Create the file

  1. Log in to cPanel.
  2. In the Files section, open File Manager.
  3. Go into public_html, or the folder of the site you want to check if it’s an addon domain or subdomain.
  4. Click + File in the toolbar.
  5. In New File Name, type a name that’s hard to guess, such as info-7k3q.php. Avoid plain phpinfo.php, as bots look for it.
  6. Click Create New File.
  7. Right click the new file and choose Edit. If a box about character encoding appears, click Edit again.
  8. Paste in this single line:
<?php phpinfo();
  1. Click Save Changes, then close the editor.

View it

Visit the file in your browser, for example https://yourdomain.co.uk/info-7k3q.php. You’ll see a purple and grey page of tables.

Use your browser’s find feature (Ctrl+F on Windows, Cmd+F on a Mac) to jump to the setting you need.

What to look for

  • PHP Version. Shown at the very top. Check it matches what your software needs.
  • Loaded Configuration File. Tells you which php.ini is in use.
  • memory_limit. The most memory one PHP request can use. Low values cause blank pages and “allowed memory size exhausted” errors.
  • upload_max_filesize and post_max_size. Together these cap how big a file you can upload through a website form or phpMyAdmin.
  • max_execution_time. How many seconds a script may run before it’s stopped.
  • max_input_vars. Too low and large menus or settings pages may not save fully.
  • Extensions. Each loaded extension, such as curl, gd, imagick, intl, mbstring or zip, has its own section further down. If a section is missing, that extension isn’t on.

Each setting shows a Local Value and a Master Value. The local value is the one your site is actually using.

Delete the file afterwards

Don’t leave the page in place. It tells anyone who finds it your exact PHP version, server paths and installed modules, which helps attackers target known weaknesses.

  1. Go back to File Manager.
  2. Right click the file and choose Delete.
  3. Tick Skip the trash and permanently delete the files if you like, then click Confirm.

Changing what you see

If a value is wrong, change it in cPanel rather than editing files by hand. Open Select PHP Version in the Software section. The Extensions tab turns modules on and off, and Options lets you raise limits like memory_limit and upload_max_filesize. See how to change your PHP version for the steps.

After a change, create the phpinfo page again to confirm the new value, then delete it.

If it doesn’t work

  • The browser downloads the file or shows the code. Check the file name ends in .php and the first characters are <?php.
  • You get a 404. The file is in the wrong folder. It must sit inside the document root of the domain you’re visiting.
  • The values don’t match what you set. Settings can differ per folder. Make sure the file is in the same folder as the site you’re checking, and allow a minute after saving changes.
  • You see a 500 error. There may be a mistake in a .htaccess file or a custom php.ini nearby. See how to find error logs in cPanel.

Still stuck? Open a support ticket and we’ll help.

Still stuck? Open a support ticket from your client area. Tell us your domain and which step went wrong, and we'll take it from there.
UK cPanel hosting from £2.99 a month

Every plan has cPanel, free SSL, backups every six hours and free migration.

See web hosting
Open in new tab