tags:

views:

61

answers:

4

I'm not sure about my platform,

can I diagnose it programatically?

A: 

You will probably want to find it buried in one of the predefined variables.

Another good place to look would be the Windows-only services.

Chacha102
A: 

If you want to do it using PHP, phpinfo(INFO_GENERAL) should show your server's information.

Arda Xi
A: 

If you're referring to the OS (not the hardware) then you should be able to get this info from php_uname.

If you want to know whether the hardware is 32 or 64-bit then on Linux you should be able to get this info from /proc/cpuinfo, on Windows you will have to use the Win32 API. Though it's quite possible that this will not work on shared hosting...

BTW You might want to check out the source code of phpSysInfo to see how you can get hardware information.

wimvds
+2  A: 

print out the max int value

echo PHP_INT_MAX;

output on 32bit hardware

2147483647

output on 64bit hardware

9223372036854775807
Thomas Winsnes