How to Check PHP Version on Linux: 3 Easy Methods

Do you want to check or verify the PHP version on Linux? Have a look at these several methods.

How to Check PHP Version on Linux?

Once done with the PHP installation, you can check its version using one of the mentioned methods.

Method 1: Check PHP Version via –version Option

To check the PHP version on Linux, such as Ubuntu 24.04, add the “–version” option in the PHP command:

php --version
checking php version with version option

Method 2: Check PHP Version via “-v” Option

To check PHP via the “-v” flag, run:

php -v
checking php version with v option

Method 3: Check PHP Version via apt list

Utilize this command to check the PHP version on Linux through apt list:

apt list --installed | grep php
checking php version with grep command

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top