How to display the installed Zend Framework version on the command line?

As per zend framework official site, version can be retrieved with command

echo Zend_Version::getLatest();

So, to access PHP in Terminal run

php -a

then

echo "Zend engine version: " . zend_version();

and press enter button to get the version information something like

Zend engine version: 2.6.0

Or check VERSION value in file Zend/Version.php if your project is using some specific version of zend framework.


With the Composer's show command in the root directory of the (ZF2 Skeleton based) project:

$ cd /path/to/project/
$ php composer show --installed
...
zendframework/zendframework 2.1.4 Zend Framework 2
...

If for whatever reason you didn't use composer to install ZF2 (come on! what's wrong with you, always use composer :)) you can run your app from the console to check the version:

$ cd <project_root>
$ php public/index.php

This assumes that index.php is your ZF2 front controller.

This will output something like:

Zend Framework 2.1.4 application
Usage: