There are several ways to check the PHP version on your server. We will cover the two simplest methods:
One method is to check the version via the command line by connecting via SSH
Notice
Keep in mind that, in some cases, the CLI version of PHP may not be the same as the version used by Apache or the web server in use, so this option may not always be the most appropriate.
Once you are logged in to your server, you can view the PHP version by running the command:
php -v
Another option is to create a PHP file with the phpinfo function.
To check the PHP version being used on a Windows server, you can use the phpinfo function. By creating a PHP file in a public folder of a domain with the phpinfo function, you can view detailed information about the PHP version your web server is using when you load that page in your browser.