问题描述
当我打开使用 laravel 5 制作的网站时出现以下错误
I am getting following error when I open my site which is made using laravel 5
致命错误:在第 14 行的 C:cmsootstrapapp.php 中找不到 Class 'IlluminateFoundationApplication'
Fatal error: Class 'IlluminateFoundationApplication' not found in C:cmsootstrapapp.php on line 14
我尝试删除供应商文件夹和 composer.lock
文件并运行 composer install 它不起作用我尝试运行 PHP artisan optimize 但它显示错误
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
致命错误:找不到类'IlluminateFoundationApplication'
Fatal error: Class'IlluminateFoundationApplication' not found
有什么办法可以解决这个问题吗?
Is there any way to solve this problem?
一旦我使用了创建模型的 php artisan make:model Page
命令,这个问题就出现了,但是当我访问该站点时会显示上述错误此外,如果使用 Laravel 的本地开发服务器,则只有在使用 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 Laravel'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
标志来防止 artisan 在它被包含之前执行.一旦我的依赖关系到位,一切都按预期工作.
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
这篇关于致命错误:找不到类“IlluminateFoundationApplication"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!