How can we help you?

How to create a phpinfo page for troubleshooting

Ella McMorran
Written by
Ella McMorran

phpinfo() outputs everything about your PHP configuration - versions, modules, settings, environment variables. Essential for debugging but also a security risk if left exposed.

Creating the phpinfo file

  1. Log into your domain’s cPanel account (not WHM reseller panel)
  2. Open File Manager from the Files section
  3. Navigate to your domain’s document root:
    • Main domain: public_html
    • Addon domain: public_html/addondomain
    • Subdomain: public_html/subdomain
Note

Important: Different directories can have different PHP configurations through .htaccess or MultiPHP settings. Create the phpinfo file in the exact location where you’re experiencing issues.

  1. Click “New File” in the top menu
  2. Name the file phpinfo.php (or something less obvious like info-temp-2024.php for security)
  3. Right-click the new file and select “Edit”
  4. If prompted for encoding, select UTF-8
  5. Add this code:
    <?php
    // Remove this file after troubleshooting!
    phpinfo();
    ?>
  6. Save the file

Viewing PHP information

Navigate to http://yourdomain.com/phpinfo.php (replace with your actual domain and filename).

You’ll see comprehensive information including:

  • PHP version and build date
  • Loaded configuration files
  • Enabled/disabled modules
  • Memory limits and execution times
  • Environment variables
  • Server information

What to look for

Common troubleshooting checks:

  • memory_limit: Insufficient memory causes white screens
  • max_execution_time: Too low causes timeout errors
  • upload_max_filesize: Limits file upload sizes
  • post_max_size: Must be larger than upload_max_filesize
  • Module status: Check if required extensions (mysqli, curl, gd) are enabled

Security warning

Warning

DELETE THE PHPINFO FILE IMMEDIATELY AFTER USE

phpinfo() exposes sensitive server information including:

  • Server paths and configuration
  • Environment variables
  • PHP version vulnerabilities
  • Loaded modules and versions

Hackers actively scan for phpinfo.php files. Name yours uniquely and remove it within minutes of troubleshooting.

Alternative: Command line method

If you have SSH access, this is safer:

php -i > phpinfo.txt

Then review the text file locally without exposing it via web.