Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

hotsaucejake's avatar

Succesfully got memcached running and can get its contents. Now I get an error when I run composer update.

Memcached is properly installed and running. I can retrieve any contents I store - I can see it's running and interact via CLI as well.

However, running composer update I get:

[Symfony\Component\Debug\Exception\FatalThrowableError]  
  Class 'Memcached' not found   

I tried removing CACHE_DRIVER in my .env file and leaving it set to memcached in my config/cache.php file.

Like I said, memcached works and I can interact with it on my application. But running composer update now results in the error above.

0 likes
2 replies
hotsaucejake's avatar

This is how I installed memcached so it may have something to do with the problem:

sudo apt-get install memcached
sudo apt-get install gcc make autoconf libc-dev pkg-config
sudo apt-get install zlib1g-dev
sudo apt-get install libmemcached-dev
sudo pecl7.1-sp install memcached

Create a configuration file for the extension and restart PHP

sudo bash -c "echo extension=memcached.so > /etc/php7.1-sp/conf.d/memcached.ini"
sudo service php7.X-fpm-sp restart

Again THIS WORKS and memcached is working correctly within Laravel. When I run composer update now it spits out the error:

[Symfony\Component\Debug\Exception\FatalThrowableError]  
  Class 'Memcached' not found  

Please or to participate in this conversation.