简体   繁体   English

PHP致命错误打开所需文件

[英]PHP fatal error opening required file

I'm having problems debugging this php error. 我在调试此php错误时遇到问题。 '/app/bootstrap.php' exists so not sure why I'm getting this error? '/app/bootstrap.php'存在,所以不确定为什么我收到此错误? Can anyone help? 有人可以帮忙吗? Thanks 谢谢

[24-Mar-2017 10:42:50 Europe/London] PHP Warning: require_once(/app/bootstrap.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/example.com/index.php on line 2
[24-Mar-2017 10:42:50 Europe/London] PHP Fatal error:  require_once(): Failed opening required '/app/bootstrap.php' (include_path='.:/Applications/MAMP/bin/php/php5.6.30/lib/php') in /Applications/MAMP/htdocs/example.com/index.php on line 2

The path /app/bootstrap.php looks like a root path ( and the root isn't your website root, but your Mac root directory). 路径/app/bootstrap.php看起来像一个根路径(该根不是您的网站根,而是您的Mac根目录)。

Change require path to __DIR__ . '/app/bootstrap.php' 将require路径更改为__DIR__ . '/app/bootstrap.php' __DIR__ . '/app/bootstrap.php' , it means to require a sccript that in /app/bootstrap.php relative to CURRENT directory. __DIR__ . '/app/bootstrap.php' ,这意味着需要在/app/bootstrap.php中相对于CURRENT目录的脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM