Try issuing a "composer dumpautoload -o" and see if that helps, i just noticed by accident that i saw this monolog sitting in my vendor/composer/autoload_psr4.php, maybe it helps.
I am having this issue as well, started about 2 hours ago... which is when the framework git repository was last updated.
Same here. I got it first after running 'composer update' and now I can't do anything, even 'artisan serve' gives the same error. "composer dump-autoload -o" was the first thing I tried, it did not help.
I was able to resolve this issue by changing my "minimum-stability" from "dev" to "stable" in composer.json. Then running composer update.
Thanks for that, it worked for me too, good job.
I want my ripped hair back! Wasted like 2 hours trying to solve this issue, and I thought it was just me.
Your tip worked jackley ;)
Thank you very much!
I am having this same issue! I was working fine until I did composer install/update. Now I get this error when trying to composer install/update:
PHP Fatal error: Class 'Monolog\Logger' not found in /Applications/XAMPP/htdocs/Capstoneconnect/vendor/laravel/framework/src/Illuminate/Log/LogServiceProvider.php on line 22 {"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Class 'Monolog\Logger' not found","file":"/Applications/XAMPP/htdocs/Capstoneconnect/vendor/laravel/framework /src/Illuminate/Log/LogServiceProvider.php","line":22}}
And When I try to open my page on my local host I get: Class 'Monolog\Logger' not found
I have tried doing all the aforementioned dumps and also changed from dev to stable, neither seem to work correctly. Any help would be greatly appreciated!
Saved me SO much time right now.... thank you!
Hey Bensnorman, I tried all the previous ones as well and didn't succeed until I tried this:
composer update --no-scripts
After doing that my site loaded fine.
Just thought I'd post it here since it helped me out.
Updating the composer.json didn't work for me.
However, updating composer (run: 'composer self-update') and THEN running a 'composer update' fixed it.
I believe this is down to Monolog moving onto being PSR-4 compliant and old versions of Composer not knowing how to generate the the autodump for PSR-4 classes.
I tip my hat to Snelvuur.. That and thanks to Google for finding me this one ;-)
@ jayhealey,
thanks, updating composer worked for me. and it also seems to be best explanation and solution for going forward.
@jayhealey's and Jackley's tips combined worked for me:
change minimum stability to "stable" -----> composer self-update ----> composer dump-autoload ----> composer update
Just downloaded Laravel from the site to try it out. Setup using Laravel. Got error on first run when viewed with browser. Installed composer. Ran
composer update
but it failed. Ran
composer update --no-scripts
and now it works. Frustrating that it didn't work out of the box but glad it's working for now.
composer self-update and composer update worked for me thx!
MikeGrace said:
Just downloaded Laravel from the site to try it out. Setup using Laravel. Got error on first run when viewed with browser. Installed composer. Ran
composer update
but it failed. Ran
composer update --no-scripts
and now it works. Frustrating that it didn't work out of the box but glad it's working for now.
Thanks! Had the same situation and this helped me out of it.
I have the exact same issue. The only difference is that I used the Laravel Installer. Composer is not installed on my PC.
The minimum-stability setting is already set to stable
, as I used the installer...
For those running an installation that was installed via laravel.phar, just run a dump-autoload. That'll fix it. :)
jayhealey said:
Updating the composer.json didn't work for me.
However, updating composer (run: 'composer self-update') and THEN running a 'composer update' fixed it.
I believe this is down to Monolog moving onto being PSR-4 compliant and old versions of Composer not knowing how to generate the the autodump for PSR-4 classes.
woo hoo! thanks jayhealey :)
It is problem for old composer. Please update your composer. I faced this same problem for composer update like
When i was needed to add twitter vendor "thujohn/twitter": "dev-master" in my Laravel4 app. After adding this in composer.json and running composer update, i got error like 'Script php artisan clear-compiled handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Monolog\Logger' not found in /var/ww
w/socialcampaign/vendor/laravel/framework/src/Illuminate/Log/LogServiceProv
ider.php on line 23'.
It was solved from my end follow in below steps..
First of all, I updated composer self,
sudo composer self-update
Then, I ran composer update,
composer update
Any help should be appreciated. Thanks.
Switch to stable as minimum solution worked while the PSR-4 autoloading was only in the dev-master branch, but not yet released. 22 days ago, it was tagged as stable, so that solution didn't have any effect anymore ;)
Proper solution is to regularly update your composer by running composer self-update
(And after that, composer update or composer dump-autoload)
Same problem here. Introduced every time artisan dump-autoload is executed. To overcome it I have to execute composer dump-autoload.
My settings: minimum-stability => "stable" / Laravel 4.1 / Composer always updated!
composer update --no-scripts is the only way to install packages.
No obvious explanation... But every update is scary...
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community