How to check what PHP version I am running

If you are a Linux command line lover you can run this and see what version of PHP you are running:

or you can alternatively run this to get strictly the version number

Find PHP version on Windows

php -v  is also working on Windows platforms. You can just start your CMD and run it to see the PHP version you currently have installed.

This will not work if you do not include php.exe in the system path. So if this is your case you will have to locate php.exe on your system. The Main is located here: C:\xampp\php  so I will run the set  command using this path:

Now run again php -v  and you should see your PHP version.

Find the PHP version when you do not have access to an SSH console.

When you do not have access to a command-line console you can find the PHP version using the phpinfo() function.

Just put it in a new .php file and access it via your URL.

Or just a simpler way is to use the phpversion()  specific function or the PHP_VERSION constant.

Why do I need to know my PHP version?

There are plenty of reasons Why you may be interested in the PHP version you are running. One would be that some functions are not available on some packages and other functions are deprecated on others.

If you want to know your PHP version and do something or something else depending on your release number you may be interested in using the compare like this.

Hope this helps you