Support the ongoing development of Laravel.io →
posted 10 years ago
Installation
Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

I am having this issue as well, started about 2 hours ago... which is when the framework git repository was last updated.

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

I was able to resolve this issue by changing my "minimum-stability" from "dev" to "stable" in composer.json. Then running composer update.

Last updated 2 years ago.
0

Thanks for that, it worked for me too, good job.

Last updated 2 years ago.
0

I want my ripped hair back! Wasted like 2 hours trying to solve this issue, and I thought it was just me.

Last updated 2 years ago.
0

Your tip worked jackley ;)

Thank you very much!

Last updated 2 years ago.
0

Thank you.

Last updated 2 years ago.
0

Thank you!!

Last updated 2 years ago.
0

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!

Last updated 2 years ago.
0

Saved me SO much time right now.... thank you!

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

it works! , Thanks Jackley

Last updated 2 years ago.
0

Thanks Jackley, work for me too.

Last updated 2 years ago.
0

I tip my hat to Snelvuur.. That and thanks to Google for finding me this one ;-)

Last updated 2 years ago.
0

@ jayhealey,

thanks, updating composer worked for me. and it also seems to be best explanation and solution for going forward.

Last updated 2 years ago.
0

@jayhealey's and Jackley's tips combined worked for me:

change minimum stability to "stable" -----> composer self-update ----> composer dump-autoload ----> composer update

Last updated 2 years ago.
0

Awesome. Thank you all !

Last updated 2 years ago.
0

Thanks a lot!

Last updated 2 years ago.
0

Thanx!

Last updated 2 years ago.
0

@jayhealey thank you, sir. composer self-update worked like a charm!

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

I just did

composer install
Last updated 2 years ago.
0

composer self-update and composer update worked for me thx!

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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...

Last updated 2 years ago.
0

For those running an installation that was installed via laravel.phar, just run a dump-autoload. That'll fix it. :)

Last updated 2 years ago.
0

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 :)

Last updated 2 years ago.
0

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..

  1. First of all, I updated composer self,

    sudo composer self-update

  2. Then, I ran composer update,

    composer update

Any help should be appreciated. Thanks.

Last updated 2 years ago.
0

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)

Last updated 2 years ago.
0

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...

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

dhpena dhpena Joined 18 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.