RE: [PHP-WIN] Re: Subject: getting the OS
| From: | Dash McElroy | Date: | Sat, 04 Jan 2003 01:13:09 +0000 |
| Subject: | RE: [PHP-WIN] Re: Subject: getting the OS | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-17639@lists.php.net to get a copy of this message | ||
I can confirm that on Windows. My linux box has PHP 4.1.2.
You could also check some of the other environment variables. I just
compared my phpinfo() screens on my w2k box and my linux box. Looks like the
solution mentioned below is the cleanest, however.
Hopefully you don't need to differentiate between different Unix flavors. If
so, it appears that _ENV contains quite a few valuable variables (although I
cannot speak for the *BSD crowd, my linux type is in there in
$_ENV['MACHTYPE'] as 'i386-slackware-linux-gnu').
-Dash
-----Original Message-----
From: Neil Smith [mailto:neil@fresh-toast.uklinux.net]
Sent: Friday, January 03, 2003 5:24 PM
To: php-windows@lists.php.net
Cc: damouse@ntlworld.com
Subject: [PHP-WIN] Re: Subject: getting the OS
On Apache Windows 2000, PHP 4.0.5
$HTTP_SERVER_VARS["SERVER_SOFTWARE"] returns :
"Apache/1.3.14 (Win32)"
On Apache Linux Redhat, PHP 4.0.6
$HTTP_SERVER_VARS["SERVER_SOFTWARE"] returns :
Apache/1.3.27 (Unix) (Red-Hat/Linux) blah blah b;ah
So, you could easily use a regex to extract the (Win32) or (Unix) strings
for your branch / test.
These variables are probably now called $_SERVER["SERVER_SOFTWARE"] under
PHP > 4.2 - anybody care to confirm these results ?
Hope that helps
Regards,
Neil Smith.
At 00:42 04/01/2003 +0000, you wrote:
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>Message-ID: <000c01c2b38a$166a01e0$3700a8c0@DaMouse>
>From: "DaMouse" <damouse@ntlworld.com>
>To: "PHP - Win" <php-windows@lists.php.net>
>Date: Sat, 4 Jan 2003 00:41:19 -0000
>MIME-Version: 1.0
>Content-Type: multipart/related;
> type="multipart/alternative";
> boundary="----=_NextPart_000_0008_01C2B389.FFECDDC0"
>Subject: getting the OS
>
>ok I develop stuff on both windoze and linux so say I left my computer
>running and forgot which it was running and wanted to make a OS specific
>script from another computer. How could I tell what OS it was to see if I
>needed to go reboot it?
>
>
>
>Ensign Baker
>HCO Officer
>USS Atlantis
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php