Page 1 of 1
How to find server operating system.
Posted: Mon Feb 26, 2007 3:40 pm
by daedalus__
i'm searching for a way to find the server operating system. I was having mild success regex'ing the $_SERVER['SERVER_SOFTWARE'] variable but I am so bad with regex that it didn't work in the end.
Perhaps someone could recommend a method?
Posted: Mon Feb 26, 2007 3:57 pm
by volka
Posted: Mon Feb 26, 2007 4:06 pm
by veridicus
The $_ENV superglobal will give you every environment variable available to the script (based on the web server, OS, etc.). So if your web server runs on a UNIX-like OS run the "set" command at the prompt and check for a variable containing useful info. On my system it's MACHTYPE. Then try it in the script and see if it's available there. This is very platform-dependent, so you may need to check a few environment variables to cover any OS the script may run on.
Posted: Mon Feb 26, 2007 4:24 pm
by daedalus__
After digging around the manual I found what I needed, thanks guys!
Posted: Mon Feb 26, 2007 4:31 pm
by volka
And exactly what are you using now?