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

居然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
提交
取消
手把手教你实现电商网站后台开发
  • 参与学习       117242    人
  • 解答问题       2101    个

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

进入课程

居然apache_get_version()报错

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号