Is there a way to check if PHP is installed on an Apache or IIS server within the PHP environment itself?
If so, how?
The virtually most definitive answer possible (there are other similar possibilities) is:
function on_iis() {
$sSoftware = strtolower( $_SERVER["SERVER_SOFTWARE"] );
if ( strpos($sSoftware, "microsoft-iis") !== false )
return true;
else
return false;
}
Now, just use on_iis()
whenever you want to know.