« OCR for PDF in Ubuntu | Home | Measure CPU temperature and your fan speed in Ubuntu Linux »
Determine the OS and version of PHP
By admin | July 16, 2008
It is very hard to determine the OS of the server/computer that is running PHP. So therefore here are two very, very useful methods to get the OS and Version of PHP.
This finds the version and OS the PHP on your server, not that person that is visiting your site.
To get the version of PHP, use phpversion()
, a hidden function in PHP. However, your OS maker may have customized this so it may not be a pure number. For example, on Ubuntu Linux it returns 5.2.4-2ubuntu5.1
, but on a Windows binary from php.net it returns 5.2.5
, which is a pure number.
And to get the OS of PHP, use the hidden constant PHP_OS. If it doesn’t work, you could also try the following, even though the chances are very unlikely:
$_ENV['OS']
$_SERVER['OS']
$_SERVER['SERVER_SOFTWARE'] // The OS Info may be in there
If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!
Topics: PHP | 18 Comments »
March 26th, 2025 at 08:15
… [Trackback]
[…] Find More Information here on that Topic: compdigitec.com/labs/2008/07/16/determine-the-os-and-version-of-php/ […]
March 29th, 2025 at 13:39
… [Trackback]
[…] Find More on to that Topic: compdigitec.com/labs/2008/07/16/determine-the-os-and-version-of-php/ […]
March 30th, 2025 at 12:43
… [Trackback]
[…] Read More Information here on that Topic: compdigitec.com/labs/2008/07/16/determine-the-os-and-version-of-php/ […]
April 3rd, 2025 at 12:39
Determine the OS and version of PHP at Compdigitec Labs
https://30framesmultimedios.com/habilita-sspm-de-sjr-unidad-movil-para-pago-de-multas-durante-semana-santa/
April 26th, 2025 at 01:26
… [Trackback]
[…] Read More Info here to that Topic: compdigitec.com/labs/2008/07/16/determine-the-os-and-version-of-php/ […]
April 27th, 2025 at 21:30
Forum
Forum
May 1st, 2025 at 18:43
… [Trackback]
[…] Read More to that Topic: compdigitec.com/labs/2008/07/16/determine-the-os-and-version-of-php/ […]
May 7th, 2025 at 05:28
t.me/s/psy_chat_online
t.me/s/psy_chat_online
May 10th, 2025 at 04:05
Sochi-psiholog-Russia
Sochi-psiholog-Russia
May 16th, 2025 at 03:20
… [Trackback]
[…] Find More here to that Topic: compdigitec.com/labs/2008/07/16/determine-the-os-and-version-of-php/ […]
May 17th, 2025 at 13:21
instagram.com/korotkovlakanfreud
instagram.com/korotkovlakanfreud
May 17th, 2025 at 23:37
5yucMCMAAAAJ
5yucMCMAAAAJ
May 30th, 2025 at 07:14
… [Trackback]
[…] Here you will find 51823 more Information to that Topic: compdigitec.com/labs/2008/07/16/determine-the-os-and-version-of-php/ […]
May 30th, 2025 at 07:28
atvip.ru
atvip.ru
May 30th, 2025 at 08:52
0410.ru
0410.ru
May 31st, 2025 at 03:51
myprin92.ru
myprin92.ru
June 4th, 2025 at 04:40
ekzistenczialnyj
ekzistenczialnyj
June 8th, 2025 at 14:48
… [Trackback]
[…] Info to that Topic: compdigitec.com/labs/2008/07/16/determine-the-os-and-version-of-php/ […]