Laravel PHP 致命错误:require(): Failed opening required ... bootstrap/autoload.php on line 17
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26887111/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel PHP Fatal error: require(): Failed opening required ... bootstrap/autoload.php on line 17
提问by Chris Till
I'm trying to deploy a website built on Laravel to an amazon ec2 micro instance. I've cloned the project and then ran composer install
with no problems. However when I view it in the browser I get the error:
我正在尝试将在 Laravel 上构建的网站部署到亚马逊 ec2 微型实例。我已经克隆了该项目,然后运行composer install
没有任何问题。但是,当我在浏览器中查看它时,出现错误:
Error in exception handler.
.
Error in exception handler.
.
In the error logs I can see the following error:
在错误日志中,我可以看到以下错误:
[Wed Nov 12 12:12:47.550414 2014] [:error] [pid 21572] [client x.x.x.x:x] PHP Fatal
error: require(): Failed opening required '/home/production/public_html/kcnr-tv/bootstrap
/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in
/home/production/public_html/kcnr-tv/bootstrap/autoload.php on line 17
I've googled this problem and a few people seem to have this issue but in almost all cases they have forgotten to run composer install
.
我在谷歌上搜索了这个问题,有些人似乎有这个问题,但在几乎所有情况下,他们都忘记了运行composer install
.
I've increased the PHP memory limit to 1GB and still no luck. There doesn't appear to be an issue with installing dependencies as far as I can see as they are all in the vendor folder after composer has finished.
我已将 PHP 内存限制增加到 1GB,但仍然没有运气。据我所知,安装依赖项似乎没有问题,因为在 Composer 完成后它们都在供应商文件夹中。
Any help with this would be great as I'm all out of ideas to what this could be.
对此的任何帮助都会很棒,因为我完全不知道这可能是什么。
回答by Jomaf
try this command
试试这个命令
composer install --no-script
this will skip the composer scripts execution as vendor files are still missing.
这将跳过作曲家脚本的执行,因为供应商文件仍然缺失。
回答by Chris Till
I fixed it with the following solution: Error in exception handler. - Laravel.
我使用以下解决方案修复了它:异常处理程序中的错误。- 拉拉维尔。
The app/storage permissions needed updating.
应用程序/存储权限需要更新。
回答by Excellent Lawrence
You need to run to
你需要跑到
composer update
回答by GidiCodes
Use dump-autoload to generate new autoload.php
使用 dump-autoload 生成新的 autoload.php
composer dump-autoload
use artisan optimize to clean the project
使用工匠优化来清理项目
php artisan optimize:clear
If you are on Linux you need to set write permission to bootstrap/cache and storage directories.
如果您在 Linux 上,您需要设置对引导程序/缓存和存储目录的写权限。
sudo chmod -R 777 bootstrap/cache storage