居然apache_get_version()报错
登陆进index页面之后提示 Fatal error: Call to undefined function apache_get_version()未定义 什么情况
登陆进index页面之后提示 Fatal error: Call to undefined function apache_get_version()未定义 什么情况
2016-01-21
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];
}
?>
举报