English 中文(简体)
Zend Server Version?
原标题:

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!

最佳回答

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.

问题回答

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

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

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

...endendServerguiconfigzs_ui.ini

Example: zend_gui.version = 9.0.1





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签