Usually that function is only available if PHP is compiled and installed as a normal Apache module. If you're running a script on the command line, then it's not running from Apache, so PHP doesn't have that function.
If you're running a script on the command line, you might have to have PHP exec() the "apache2 -version" command and parse the first line:
2016-08-26
sorry ,i answered it ?in ?english?
2016-08-26
Usually that function is only available if PHP is compiled and installed as a normal Apache module. If you're running a script on the command line, then it's not running from Apache, so PHP doesn't have that function.
If you're running a script on the command line, you might have to have PHP exec() the "apache2 -version" command and parse the first line:
<?
exec("apache2 -version",$outputlines);
if(preg_match("/(Apache\/[0-9\.]+)/",$outputlines[0],$matches))
{
? ?print $matches[1];
}
?>