为了账号安全,请及时绑定邮箱和手机立即绑定

居然apache_get_version()报错

登陆进index页面之后提示 Fatal error: Call to undefined function apache_get_version()未定义   什么情况

正在回答

2 回答

sorry ,i answered it  in  english 

0 回复 有任何疑惑可以回复我~

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];
}
?>

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
手把手教你实现电商网站后台开发
  • 参与学习       117284    人
  • 解答问题       1999    个

手把手教你用PHP搭建电子商务平台,由浅入深教你搭建电商系统

进入课程

居然apache_get_version()报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信