views:

46

answers:

1

How can I receive the Zend Server version by a PHP script running on this Zend Server?

phpinfo() and the commandline php -v does not tell the Zend Server version!

+2  A: 

You cannot derive the Server version from phpinfo (or the environment for that matter).

I assume you are after the values that are displayed in the Server Control GUI at Monitor | Server Info, e.g. version and build. They are stored in in $InstallDir/GUI/application/data/zend-server.ini. Your application has to have access to the folder where the Ini is located, load the Ini file (with something like Zend_Config) and then you can work with the values.

Note that ZS is build with ZF and the files are not obfuscated, so you can check out their source code to see how they access this information. Might very well be possible to reuse some of their code.

Gordon
Thanks! The zend-server.ini is a very good hint!
powtac