致命错误:找不到类"Illuminate \ Foundation \ Application" [英] Fatal error: Class 'Illuminate\Foundation\Application' not found
问题描述
当我打开使用laravel 5制作的网站时,出现以下错误
I am getting following error when I open my site which is made using laravel 5
致命错误:在第14行的C:\ cms \ bootstrap \ app.php中找不到类'Illuminate \ Foundation \ Application'
Fatal error: Class 'Illuminate\Foundation\Application' not found in C:\cms\bootstrap\app.php on line 14
我尝试删除供应商文件夹和composer.lock
文件并运行composer安装不起作用,我尝试运行PHP artisan优化,但显示错误
I have tried removing vendor folder and composer.lock
file and running composer install it's not working I tried running PHP artisan optimize but it shows error
致命错误:找不到类'Illuminate \ Foundation \ Application'
Fatal error: Class'Illuminate\Foundation\Application' not found
有什么办法可以解决这个问题?
Is there any way to solve this problem?
我使用确实创建模型的php artisan make:model Page
命令后就引起了此问题,但是当我访问该站点时会显示上述错误
另外,如果使用Larvel的本地开发服务器,则仅当我使用wamp服务器时,不会出现此类问题
Edited:
This problem aroused as soon as I used the php artisan make:model Page
command which did create the model but then the above error gets displayed when I access the site
Also If use the Larvel's Local Development Server no such problem arises only if I use wamp server
推荐答案
在我的情况下,我没有完整的供应商依赖项(在原始安装过程中弄乱了Composer文件)-因此,运行任何artisan命令都会导致失败.
In my situation, I didn't have the full vendor dependencies in place (composer file was messed up during original install) - so running any artisan commands caused a failure.
我能够使用--no-scripts
标志来防止工匠在被包括之前执行.一旦建立我的依赖关系,一切都会按预期进行.
I was able to use the --no-scripts
flag to prevent artisan from executing before it was included. Once my dependencies were in place, everything worked as expected.
composer update --no-scripts
这篇关于致命错误:找不到类"Illuminate \ Foundation \ Application"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!