Is there a way to check if PHP is installed on an Apache or IIS server within the PHP environment itself?
If so, how?
I don't know with what PHP version it became available, but try this:
if( strpos( $_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) echo 'Have Apache'; else echo 'Have some other server';