PHP settings can differ between websites and between the web server and command line. A temporary phpinfo() page shows the PHP version and configuration used when your chosen website handles a web request.

Create a temporary diagnostic page

  1. In cPanel, check the domain’s document root under Domains.

  2. Open File Manager and navigate to that directory. It is not always public_html.

  3. Create a new file named phpinfo-check.php. Do not overwrite an existing file.

  4. Edit the file, add the following code and save it:

    <?php
    phpinfo();

Check the version and remove the file

  1. Open https://example.com/phpinfo-check.php, replacing the example domain with yours. Use the appropriate path if the file is in a protected subdirectory.
  2. Check PHP Version and the configuration values you need.
  3. Delete the diagnostic file in File Manager.
  4. Confirm that its URL no longer displays the information. Remove any cached copy if a proxy or CDN cached the response.

The result applies to that website request. A command-line php -v result may use a different PHP installation.