Uncaught ReflectionException: Class log does not exist Laravel 5.2

前端 未结 25 2192
长情又很酷
长情又很酷 2020-11-27 17:15

I am currently trying to clone an existing project of mine from github. After clone I run composer install during the process I receive the following error:

25条回答
  •  被撕碎了的回忆
    2020-11-27 17:29

    The underlying error is revealed by modifying vendor/laravel/framework/src/Illuminate/Container/Container.php and placing the following at the top:

    monolog = new Monolog("local");
           }
        }
    }
    
    //Add curly-braces around the original content, like so:
    
    namespace Illuminate\Container {
        //All original code in this file goes here.
    
        //...
    }
    

    (Credit to https://laracasts.com/discuss/channels/general-discussion/class-log-does-not-exist/replies/160902 for this idea.)

    To add to the list of root-causes for this message, defining a closure in a configuration file and calling php artisan config:cache subsequently will cause this (at least in Laravel 5.1). Solution for this manifestation: don't define closures in Laravel configuration files, per https://github.com/laravel/framework/issues/9625 .

提交回复
热议问题