Do you want to check or verify the PHP version on Linux? Have a look at these several methods.
Table of Contents
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
Method 2: Check PHP Version via “-v” Option
To check PHP via the “-v” flag, run:
php -v
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
I’m a professional technical content writer who has 4+ years of experience with different operating systems, programming languages, GUI-based apps, IT, and technology in general.