Detecting the servers OS

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Dear newsgroup,

I'm using php and mysql with apache both on Slackware linux and also Windows
using phpdev.  I developed the code on the linux system.  On phpdev I've
found that glob and mysql_real_escape_string do not work.  I've created
workrounds for this on phpdev.  The question is, is there a reliable way to
detect the OS so I can use the workrounds on phpdev only, or am I better
off using the workround on both phpdev where it is needed and under linux,
where it is not?

I assume that the most reliable way to detect the server OS is to look at
the Apache version, after finding out how phpinfo() gets this and looking
for (Unix) or (Win32) in the returned data.


Re: Detecting the servers OS

Peter Chant wrote:

Quoted text here. Click to load it

Maybe even php_uname!  Typical, found the answer straight after posting (and
I googled before posting).


Site Timeline