Contrary to the last note, PHP_OS does display the OS PHP runs on currently, whereas php_uname() displays the Operating system version via uname.
This has nothing to do with the system PHP was built on.
![]() |
|
||||||||||
|
php_uname(PHP 4 >= 4.0.2, PHP 5) php_uname -- Returns information about the operating system PHP is running onDescriptionstring php_uname ( [string mode] )php_uname() returns a description of the operating system PHP is running on. For the name of just the operating system, consider using the PHP_OS constant, but be reminded this constant will contain the operating system PHP was built on. On Unix, the output reverts to displaying the operating system information PHP was built on if it cannot determine the currently running OS.
There are also some related Predefined PHP constants that may come in handy, for example:
See also phpversion(), php_sapi_name(), and phpinfo(). php_uname
simon at NOSPAM dot zadra dot org
19-Jan-2006 09:26
Contrary to the last note, PHP_OS does display the OS PHP runs on currently, whereas php_uname() displays the Operating system version via uname.
michiel1978 /*at*/ hotmail /*dot*/ com
11-Dec-2005 02:38
Example 1 in this article is a little bit misleading. The comment on the last block of code says it will output the server's operating system, but in reality (and according to this same article), it will output the operating system on which PHP was built, because it uses the constant PHP_OS.
tac at smokescreen dot org
14-Jan-2005 03:25
In php 4.1.2, php_uname('n') returns a warning about an invalid parameter count. Change it to @php_uname to hide this warning.
|