Find out the version of your Raspberry Pi’s installed PHP with ease.

Learn how to check your Raspberry Pi’s current PHP version using the command line interface. This article will show you step-by-step instructions on how to do this and interpret the results correctly. …


Updated October 14, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


Learn how to check your Raspberry Pi’s current PHP version using the command line interface. This article will show you step-by-step instructions on how to do this and interpret the results correctly.

To check the PHP version on a Raspberry Pi, you need to open up the terminal and type in the following command:

php -v

This will output information about your installed PHP version, including the version number, compile date, and configure options. Here’s an example of what the output might look like:

PHP 7.3.24 (cli) (built: Feb  9 2021 15:58:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.24, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.24, Copyright (c), by Zend Technologies

In this example, the PHP version is 7.3.24. If you have multiple versions of PHP installed on your Raspberry Pi, you can also use the following command to check a specific version:

php7.3 -v

Replace 7.3 with the version number you want to check. If the specified version is not installed, you will receive an error message.

Remember that you may need to use sudo before the command if you’re checking PHP versions in directories or files that require administrative privileges:

sudo php -v

or

sudo php7.3 -v

That’s it! Now you know how to check your Raspberry Pi’s installed PHP version using the command line interface. Happy coding!