Uncaught ReflectionException: Class log does not exist Laravel 5.2

前端 未结 25 1830
长情又很酷
长情又很酷 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:32

    Yes as said by @jakehallas . Its not related to what is showing in exception.

    Actually if there is any dababase issue or other config varilables issue causes this.

    Actually when i tried to change something in database.php i just duplicated same file as database-copy.php. I didn't execpt this causes issue.

    After gone through what i have done before i just removed this database-copy.php file its working fine..

    Thanks ...

    0 讨论(0)
  • 2020-11-27 17:36

    I was typing a CMD in the CLI and accidentally typed it in the app config file. I had to follow this procedure in order to find the problem.

    Solution, how to find problem:

    • make a backup copy of config folder. try to delete one config at a
    • time and try to run composer/artisan command that failed. When you
    • find file that failed - search for a row that can possibly fail.
    • Reason why it is failed is: You use class constant that is not loaded
    • yet. You use class/function that is not loaded yet. etc

    https://laracasts.com/discuss/channels/general-discussion/class-log-does-not-exist?page=2

    0 讨论(0)
  • 2020-11-27 17:37

    In your .env file make sure you have no spaces for values

    for example this is allowed

    DB_USERNAME=homestead
    

    this is not allowed

    DB_USERNAME=home stead
    

    you can wrap the value in quotes if you have spaces.

    DB_USERNAME="home stead"
    

    really wish they used json for the .env file, maybe we should request that feature

    0 讨论(0)
  • 2020-11-27 17:37

    In my case, a comma is missing in my config file (config/app.php) after I merged my branch to master.

    my code snippet

    it was a syntax error, but didn't display it.

    0 讨论(0)
  • 2020-11-27 17:38

    When composer updating, i think laravel makes some validations.

    • Install "unzip" package("sudo apt install unzip") if not installed.
    • Check all required extensions such as "mysql", "json", "curl", "xml", "zip", etc. and install("sudo apt install php7.1-mysql") if not installed.
    • Check your file/folder permissions.
    • Check your ".env" file.
    • Check your "config" files.
    • Run "composer update" again.

    Installing unzip works for me. Good Luck :)

    0 讨论(0)
  • 2020-11-27 17:40

    In my case, the missing of PDO extension was the problem. After installing it, the problem was fixed.

    0 讨论(0)
提交回复
热议问题