Jump to content

How to reliably determine if server is Apache?


random1

Recommended Posts

If PHP is running as an Apache module then you can use

if (function_exists("apache_get_version") && strncmp(apache_get_version(), "Apache", 6) == 0) {

If it's running as CGI... there might be something in $_SERVER or $_ENV, but I don't think you could rely on it.

 

Wondering why you're checking for this...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.