欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Fatal error: Class ‘Illuminate\Foundation\Application’ not found 有大用

直接git 下来的项目 访问网站 或 运行 php artisan 出现下面的错 
Fatal error: Class 'Illuminate\Foundation\Application' not found in D:\xampputf8
\htdocs\laravel-croppic\bootstrap\app.php on line 14

question

I am getting following error when I open my site which is made using laravel 5

Fatal error: Class 'Illuminate\Foundation\Application' not found in C:\cms\bootstrap\app.php on line 14
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

Fatal error: Class'Illuminate\Foundation\Application' not found
Is there any way to solve this problem?

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

Solution 正确答案

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.

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 或者 composer install --no-scripts  (如果还不行的话 就删除掉composer.lock试试)
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
 

普通分类: