Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

enter image description here

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?

like image 319
Musterknabe Avatar asked Jan 23 '26 22:01

Musterknabe


1 Answers

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!

like image 181
Gilberto Albino Avatar answered Jan 26 '26 12:01

Gilberto Albino