Laravel Lumen Memcached not found

后端 未结 12 1755
無奈伤痛
無奈伤痛 2021-01-31 01:55

Ok, I just started with Lumen and I\'m trying to use the Auth, but a call to either Auth::check or any other function of Auth.. leads to the below Error Fatal error: Cla

相关标签:
12条回答
  • 2021-01-31 02:31

    Check if memcached is installed, if not install it by running:

    apt-get install php5-memcached
    
    0 讨论(0)
  • 2021-01-31 02:33

    In my case i added Add CACHE_DRIVER=array in .env file
    Then

    Dotenv::load(__DIR__.'/../');
    

    in my bootstrap/app.php and the .env file started working.

    0 讨论(0)
  • 2021-01-31 02:35

    I had a similar problem now, I couldn't track it down but my guess is that it has something to do with the fact that the defaults configurations are stored in the vendor/laravel/lumen-framework/config folder, the DotEnv::$inmutable setting and the artisan serveserver.

    The solution that worked for me was:

    1. Add in bootstrap/app.php the following: Dotenv::makeMutable(); Dotenv::load(__DIR__.'/../'); Dotenv::makeImmutable();

    2. in the .env file, set all the configuration to "basic drivers" (array, file) even if you are not going to use them, because you w

    0 讨论(0)
  • 2021-01-31 02:36

    You may need to restart your server, especially if you're using php artisan serve.

    Lumen doesn't appear to pick up .env changes per-request.

    I had exactly the same issue - trying to use file cache, but received errors regarding Memcached - restarting the server reloads the .env file.

    0 讨论(0)
  • 2021-01-31 02:36

    Make sure not to get caught out by your .env file not being loaded, which by default it's commented out in Lumen. So if you are specifying a different cache driver in your .env, do the following.

    Note: If you are using the .env file to configure your application, don't forget to uncomment the Dotenv::load() method in your bootstrap/app.php file.

    Source: http://lumen.laravel.com/docs/cache

    0 讨论(0)
  • 2021-01-31 02:40

    This issue resolved when i installed this package so try at least

    First i tried this and it works fine

    CACHE_DRIVER = array 
    

    but then thought about what is memcached

    Then i tried this and it works fine without changing driver memcached

    apt-get install php-memcached 
    
    0 讨论(0)
提交回复
热议问题