views:

189

answers:

13

Short story: I need to write a PHP script which finds the correct OS type from uname (eg: both wince and winnt would return windows). See here for more info.

Shouldn't this be a community wiki?

Yes but...see here.

How to help: If your OS is not listed below, please run this code and share your findings:

<?php
    echo php_uname();
?>

List of shared results

  • Darwin ... 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386
  • Darwin ... 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
  • Windows NT ... 6.1 build 7600
  • Linux ... 2.6.24-24-xen #1 SMP Tue Aug 18 18:15:39 UTC 2009 x86_64
  • Linux ... 2.6.34.7-56.fc13.x86_64 #1 SMP Wed Sep 15 03:36:55 UTC 2010 x86_64
  • Linux ... 2.6.32-25-generic #44-Ubuntu SMP Fri Sep 17 20:26:08 UTC 2010 i686
  • Windows NT ... 5.1 build 2600
  • Windows NT ... 6.0 build 6002 (Windows Server 2008 Standard Edition Service Pack 2) i586
  • Windows NT ... 6.1 build 7600 ((null)) i586

It's interesting to note that even when certain conditions match exactly, uname still produces different results.

A: 

Windows 7 Professional 64-bit, PHP 5.3 32-Bit:

Windows NT *Name of my machine* 6.1 build 7600 ((null)) i586
Pekka
A: 

Gentoo linux, 32bit, PHP 5.2:

Linux office 2.6.35-gentoo-r8sh #1 SMP PREEMPT Tue Sep 28 13:35:58 EEST 2010 i686
Māris Kiseļovs
A: 

Mac OS X 10.6.4, php 5.3.2

Darwin [myMachineName] 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386
Eiko
Was gonna paste mine, but it matches this exactly.
BoltClock
A: 

Windows 2008 Server 64-Bit, PHP 5.2 32-Bit both through Apache and in CLI:

Windows NT *Name of machine* 6.0 build 6002 (Windows Server 2008 Standard Edition Service Pack 2) i586
Pekka
A: 

Mac OS Snow Leopard (imac 24")

Darwin XXXXXXX-YYYYYYY.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386
Where XXXX-YYYY is my name and surname

Windows XP SP3

Windows NT XXXXXX 5.1 build 2600
where XXXXX is machine name

cichy
A: 

Fedora 13 64 bits:

greg@liche :) ~ > php -a
Interactive shell

php > echo php_uname();
Linux liche.gregnet 2.6.34.7-56.fc13.x86_64 #1 SMP Wed Sep 15 03:36:55 UTC 2010 x86_64
greg0ire
A: 

Ubuntu 10.4 32bit, PHP 5.3.2

Linux sagen-laptop 2.6.32-25-generic #44-Ubuntu SMP Fri Sep 17 20:26:08 UTC 2010 i686

Debian GNU/Linux 4.0 (etch) 32bit, PHP 5.2.0

Linux sagen-server 2.6.18-028stab062.3 #1 SMP Thu Mar 26 14:46:38 MSK 2009 i686

Alexander Sagen
A: 

Ubuntu 10.04, 64 bit, with PHP Version 5.3.2:

Linux MY_SYSTEM_NAME 2.6.32-25-generic #44-Ubuntu SMP Fri Sep 17 20:05:27 UTC 2010 x86_64

Bart Kiers
A: 

Ubuntu 10.10 32bit (i686)

PHP version

PHP 5.3.3-1ubuntu9.1 with Suhosin-Patch (cli) (built: Oct 15 2010 14:17:04)

Output:

Linux lenovo-t60 2.6.35-22-generic #34-Ubuntu SMP Sun Oct 10 09:24:00 UTC 2010 i686
Octavian Damiean
A: 

Ubuntu 10.10 64bit, PHP 5.3.3:

Linux *name of machine* 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:32:27 UTC 2010 x86_64

slosd
+3  A: 

Seems like this is the browscap for uname. Feel free to edit/update this list:

  • Ubuntu 10.10 32bit (i686)
Linux SYSTEM_NAME 2.6.35-22-generic #34-Ubuntu SMP SYSTEM_DATE i686
  • Ubuntu 10.04 32bit, PHP 5.3.2
Linux SYSTEM_NAME 2.6.32-25-generic #44-Ubuntu SMP SySTEM_DATE i686
  • Ubuntu 10.04 x64
Linux SYSTEM_NAME 2.6.32-25-generic #44-Ubuntu SMP SYSTEM_DATE x86_64t
  • Debian GNU/Linux 4.0 (etch) 32bit, PHP 5.2.0
Linux SYSTEM_NAME 2.6.18-028stab062.3 #1 SMP SYSTEM_DATE i686
  • Gentoo linux, 32bit, PHP 5.2:
Linux SYSTEM_NAME 2.6.35-gentoo-r8sh #1 SMP PREEMPT SYSTEM_DATE i686
  • Fedora 13 64 bits:
Linux SYSTEM_NAME 2.6.34.7-56.fc13.x86_64 #1 SMP SYSTEM_DATE x86_64
  • Centos 5.5 x86:
Linux SYSTEM_NAME 2.6.18-194.17.1.el5 #1 SMP SYSTEM_DATE i686
  • Mac OS Snow Leopard (imac 24")
Darwin SYSTEM_NAME.local 10.4.0 Darwin Kernel Version 10.4.0: SYSTEM_DATE; root:xnu-1504.7.4~1/RELEASE_I386 i386
  • Windows 7 Professional 64-bit, PHP 5.3 32-Bit:
Windows NT SYSTEM_NAME 6.1 build 7600 ((null)) i586
  • Windows 2008 Server 64-Bit
Windows NT SYSTEM_NAME 6.0 build 6002 (Windows Server 2008 Standard Edition Service Pack 2) i586
  • Windows XP SP3
Windows NT SYSTEM_NAME 5.1 build 2600
Tim Lytle
A: 

Centos 5.5 x86:

Linux <hostname>.<domainname> 2.6.18-194.17.1.el5 #1 SMP Wed Sep 29 12:51:33 EDT 2010 i686
kskjon
A: 

Windows 7 64bit with php-5.3.3-nts-Win32-VC9-x86

Windows NT <name> 6.1 build 7600 (Unknow Windows version Ultimate Edition) i586
Gordon