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?
How to find server operating system.
Moderator: General Moderators
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
What about http://de2.php.net/php_uname ?
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.
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm