Class 'Illuminate\Foundation\Application' not found - laravel-5

I'm just simply run composer update command and than my hole project is stop and show the
Class 'Illuminate\Foundation\Application' not found
I tried to run many command but not work.
like-
composer update --no-scripts
composer install
composer dump-autoload
Please help.

To solve the problem, delete composer.lock and the vendor folder and run the command composer install.
If you added to your composer.json dependencies, please delete this, because can be the cause of the error.

Related

Laravel 5.5 install not generating .env file

I have installed laravel 5.4 multiple times.
Now I'm trying to install laravel 5.5 using same command And it doesn't work.
composer create-project --prefer-dist laravel/laravel blog dev-develop
It doesn't seem to have any errors on installation, only lot of suggestions.
But no key is generated and no .env file is created.
When I try to make php artisan key:generate
/public_html/blog/.env): failed to open stream: No such file or directory
Got the same problem days a go, the problem was because composer was not updated, solved it updating composer, you can run:
composer self-update
Or you can download the latest version there, then you can create the project again and the .env file will be automatically created.
I have this version
Composer version #package_branch_alias_version# (1.0.0-beta2) 2016-03-27 16:00:34
When I run composer self-update I get
[InvalidArgumentException]
Command "self-update" is not defined.
shell command: cp .env.example .env
If you just want to make current setup work, just try doing the following:
cp .env.example .env
php artisan key:generate
But as suggested by one of the answers here, you should update your composer if you have an old version. To check your installed version, do so with composer -v
This is happening because of your Laravel Installer or Composer version. I have faced the same problem and found following 2 different solutions:
Generally, you can solve with by running composer global update command and then run composer update command from your project directory. This solution basically updates your installer and then your project.
If still, you have this problem, then you need to run composer self-update command first and then run composer update command from your project directory. It will update your composer version and then your project.
Hope this information will help you to fix.

Class 'Illuminate\Foundation\Application' not found in laravel 5.4

I was create latest laravel project using
composer create-project --prefer-dist laravel/laravel test
After when i run php artisan serv then give me error like:
failed to open stream: No such file or directory in
/var/www/html/test/bootstrap/autoload.php on line 17
After i was run composer dumpauto and solved my problem and after i run php artisan serv then still get error as:
Class 'Illuminate\Foundation\Application' not found in
/var/www/html/sample-project/bootstrap/app.php on line 14
Please help me and solve my issue
Thanks in advance
You should try this:
Please run below command:
composer install --no-scripts
In my case it worked removing "vendor" folder and "composer.lock" and then run:
composer install
Watch step wise step in video tutorial for your problem
Expert Suggestion
then after delete your vendor folder and then hit compser install

Cannot install Laravel correctly

I followed all the instruction by installing composer and then Laravel. Also I did everything what was shown in laracast series for installing Laravel and composer.
BUT I have some problems and I cannot solve them:
I don't have Vendor folder in my Laravel app folder
I cannot launch command 'composer artisan' as it says that
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "artisan" is not defined"
"php artisan" also doesn't work
All the answer in the web I have already tried to resolve my problems but nothing worked for me
Please, tell me, how can I install Laravel correctly and use it without errors
Run composer install or composer update. This will create the vendor folder and download all the dependent modules as mentioned in the composer.json
I want to add some more details which are asked but not clearly answered.
You did not install the composer dependencies. Try composer install.
It is not composer artisan. If you execute that command, you say hey composer! run your artisan command. And it says "Command "artisan" is not defined."
It is php artisan. But if you don't run composer install, php artisan will not work either. Because you are missing Symfony Console Component in your project (not the one used by composer) as well as a complete Laravel installation. Both will also be installed by the composer install command.
Well. I've solved my problem. As I mentioned before I had tried all the answer in the web but nothing had helped me. So then I just deleted my laravel project and ran this command
sudo apt-get upgrade
After some time packages were upgraded and I created new Laravel project. And Laravel started working perfectly! So in any incomprehensible situation do apt-get upgrade :))

Class 'Monolog\Logger' not found, installation error in Laravel 4

I installed Laravel without using composer with typing this command:
C:\wamp\www\travail>laravel new project
It seems that it is on the good way.
Creating application...
Application ready! Build something amazing.
But when I tried to open my project here:
wamp-->localhost-->travail-->project-->public
I got this error:
Class 'Monolog\Logger' not found
I solve this issue by doing the following:
Check the minimum-stability value in composer.json and set it to stable:
"minimum-stability": "stable"
Update you composer:
composer self-update
Re-run composer udpate:
composer update
Then run any artisan commands and enjoy coding!
According to this thread. Change minimum-stability from dev to stable in composer.json, then run an update. Also try to do a dump-autoload.
Finally it works for me after running these two commands:
composer self-update
Then:
composer update --no-scripts

artisan or composer commands - php fatal error

I made one change in my composer.json including Facebook SDK package (http://packagist.org/packages/facebook/php-sdk).
So during the composer update I got this error
$ php artisan optimize
PHP Fatal error: Interface 'SessionHandlerInterface' not found in
/Users/Leandro/www/bootstrap/compiled.php on line 2644
After this, I can't run artisan or composer commands. Always get the same error.
I tried to remove Facebook SDK from composer json but not works.
Some help? Using --no-scripts the command works fine:
composer update --no-scripts
try to do this :
composer dump-autload
composer update
i think this may or may not solve it for you ..
you may need to delete the .json file which can be found on app\storage\meta, not 100% sure but it might work ..
Check out this troubleshooting checklist, sounds like you need to do a php artisan dump-autoload though.

Resources