linux list php versions code example

Example 1: get the list of php versions installed

I use the following command to view installed PHP versions in Ubuntu:
========================================================================
sudo update-alternatives --list php

Example 2: php version command linux

# php -v
PHP 5.4.16 (cli) (built: Mar  7 2018 13:34:47) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

Example 3: php version command linux

# php --version
PHP 5.4.16 (cli) (built: Mar  7 2018 13:34:47) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

Tags:

Php Example