How to see all available PHP variables using phpinfo

Published: July 31, 2023


To see all available PHP variables using PHPInfo in cPanel, follow these steps:

  1. Log in to your cPanel account.
  2. In the Files section, click on “File Manager.”
  3. Navigate to the public_html folder or the root directory of the website you want to check.
  4. Click on “+File” at the top left corner to create a new file.
  5. Name the new file phpinfo.php and click “Create New File.”
  6. Locate the phpinfo.php file in the list, right-click on it, and select “Edit.”
  7. In the text editor, add the following code:
<?
php phpinfo();
?>
  1. Now, open a new tab in your web browser and navigate to yourdomain.com/phpinfo.php (replace yourdomain.com with your actual domain name).
  2. The page that loads will display all the PHP configuration settings for your server, including all available PHP variables.


    Remember, for security reasons, you should delete the phpinfo.php file when you’re done using it. Leaving it on your server can expose sensitive information about your server’s PHP configuration.