简体   繁体   中英

Laravel/Lumen: Could not establish Memcached connection

I wanted to use caching in my project and thought I'd use Memcached. For that, I installed memcached.

When I output my phpinfo(); I can see, that the extension exists

在此输入图像描述

However, when wanting to use it with Cache::get() , I get the following error:

Could not establish Memcached connection.

I have the following values in my .env

MEMCACHED_HOST=127.0.0.1
MEMCACHED_PORT=11211

My php.ini has the following content for memcached

extension=memcached.so

What do I need to do, to use memcached now and establish a connection successfully?

The Exceptions says:

Could not establish Memcached connection

So, PHP Memcached "extension" can not "connect" to "Memcached".

Please, try installing:

sudo apt-get install memcached
sudo service memcached status

And you are ready to go!

Are you sure memcached itself is running?

sudo service memcached status

If it's off you need to start it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM