php错误500 ;End of script output before headers: index.php

10 篇文章 0 订阅

以前能正常运行,今天切换php版本遇到下面的问题:

[Sun Apr 19 11:04:52.224694 2020] [core:notice] [pid 9164:tid 392] AH00094: Command line: 'E:\\WebSite\\PHP\\phpStudy2016\\Apache\\bin\\httpd.exe -d E:/WebSite/PHP/phpStudy2016/Apache'
[Sun Apr 19 11:04:52.234694 2020] [mpm_winnt:notice] [pid 9164:tid 392] AH00418: Parent: Created child process 8616
[Sun Apr 19 11:04:53.778782 2020] [mpm_winnt:notice] [pid 8616:tid 408] AH00354: Child: Starting 150 worker threads.
[Sun Apr 19 11:04:56.417933 2020] [core:error] [pid 8616:tid 1880] [client 127.0.0.1:50410] End of script output before headers: index.php

 

参照:https://www.zhaokeli.com/article/8547.html 无效

参考:https://segmentfault.com/q/1010000014298584/a-1020000017977891

php.ini里面注释小对应插件,还是有问题:

切换其他版本php倒是能正常执行,应该是配置问题了

配置 php.ini
error_reporting = E_ALL
log_errors = On
error_log = php_errors.log

 

刷新页面后打开php_errors.log:

[19-Apr-2020 11:52:04 Asia/Shanghai] PHP Warning:  Unknown: open_basedir restriction in effect. File(\www\app\index.php) is not within the allowed path(s): (C:/Windows/Temp/;C:/Temp/;E:/WebSite/PHP/temp/session/) in Unknown on line 0
[19-Apr-2020 11:52:04 Asia/Shanghai] PHP Warning:  Unknown: failed to open stream: Operation not permitted in Unknown on line 0

原来是不记得什么时候配置了open_basedir,

这个是用来限制php的目录访问权限什么的,如果不在允许的范围内,php就不能访问。

将其注释掉即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值