3

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!

powtac
  • 40,542
  • 28
  • 115
  • 170
  • 3
    I don't know, but I'm sure `phpinfo()` will tell you. – Pekka Feb 03 '10 at 17:31
  • I think you're right. http://kb.zend.com/index.php?View=entry&EntryID=91 – Kothar Feb 03 '10 at 17:38
  • Zend Server != PHP interpreter! phpinfo() does not tell the Zend Server version!!! Also the the solution by Mike does not tell the Zend Server version. – powtac Feb 03 '10 at 18:20

4 Answers4

2

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
  • 312,688
  • 75
  • 539
  • 559
1

A quick and dirty way to get it:

$ cat /usr/local/zend/gui/application/data/zend-server.ini | grep version

Here you would replace /usr/local/zend with whatever alternative path you might have chosen.

And you'll get some output like:

version = 5.6.0
Yes Barry
  • 9,514
  • 5
  • 50
  • 69
0

You can use the following command: echo Zend_Version::VERSION;

kta
  • 19,412
  • 7
  • 65
  • 47
0

Open the zend server .ini file (zs_ui.ini) and find version.

...\Zend\ZendServer\gui\config\zs_ui.ini

Example: zend_gui.version = 9.0.1

KevDev
  • 59
  • 4