How to check PHP version and configuration
The PHP version used by a website depends on the hosting provider and account configuration. It can differ between the command-line interface (CLI) and the web server, so check the environment that actually runs your site. For Linux or macOS over SSH, or Windows Command Prompt or PowerShell, run php -v if PHP CLI is installed and available on your PATH. This reports the command-line version only; it may differ from the PHP version used by the website through its web server or PHP-FPM handler.
To check the PHP version assigned to a domain, open cPanel and look under Software for MultiPHP Manager or Select PHP Version. The interface and available versions depend on the hosting provider. Select the domain and read its assigned PHP version before changing anything. For current cPanel behavior, see cPanel’s MultiPHP Manager documentation:

You will see the current PHP version above PHP extensions:
Another way to inspect PHP configuration is the phpinfo() function, which displays detailed PHP build, extension, server and environment information. Use it only behind access restrictions and remove the temporary file immediately; never leave a public phpinfo page online.
1. Log into your cPanel account, go to Files section > File Manager menu:
2. Navigate to public_html directory, click on New File and create a phpinfo.php file:
3. Find the newly created file in the list and click on Code Editor:
4. Add the lines of the code provided below to the file and click on Save Changes:
<?php
phpinfo();
?>
5. To see the detailed information about PHP configuration of your account, open http://yourdomain.com/phpinfo.php link in your browser, replacing yourdomain.com with your main domain name.
NOTE: A public phpinfo page can reveal server and environment details. Prefer the hosting panel or command line; if a temporary file is unavoidable, restrict access before testing and remove it immediately afterwards.
1. Log into your cPanel account, go to the section Files > File Manager menu:
2. Navigate to the public_html directory, click on New File and create a phpinfo.php file:
3.Find the newly created file in the list and click on Code Editor:
4. Add the lines of the code provided below to the file and click on Save Changes:
<?php
phpinfo();
?>
5. To see the detailed information about PHP configuration of your account, open http://yourdomain.com/phpinfo.php link in your browser, replacing yourdomain.com with your main domain name.
NOTE: A public phpinfo page can reveal server and environment details. Prefer the hosting panel or command line; if a temporary file is unavoidable, restrict access before testing and remove it immediately afterwards.
That’s it!









Leave a Reply