random1 Posted November 10, 2010 Share Posted November 10, 2010 How to reliably determine if server is Apache using PHP? For example isApache() function? Quote Link to comment Share on other sites More sharing options...
radar Posted November 10, 2010 Share Posted November 10, 2010 You could always try using: $version = apache_get_version(); I haven't used it myself, but it appears as though it'd work for you. Who knows if it'll throw errors if the server isnt running apache though. Quote Link to comment Share on other sites More sharing options...
requinix Posted November 10, 2010 Share Posted November 10, 2010 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... Quote Link to comment Share on other sites More sharing options...
random1 Posted November 10, 2010 Author Share Posted November 10, 2010 Thanks all... I will be using this function to determine Apache during a setup script Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.