On my server apache_get_version() will end all web page output, just like die(), with no errors.
So use;
<?php
if(function_exists("apache_get_version")){
$AVerpache = apache_get_version();
} else {
$AVerpache = "unknown";
}
print $AVerpache;
?>
The following may work on your server and return "Apache/x.x.xx"
<?php
print $_SERVER["SERVER_SOFTWARE"];
?>
but on mine it only returns "Apache".