0

I'm getting:

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)

Class 'Memcached' not found

After upgrading from Ubuntu 17.04 to 17.10.

The code calling memcached:

/**
 * Get a new Memcached instance.
 *
 * @return \Memcached
 */
protected function getMemcached()
{
    return new Memcached;
}

I tried re-installing php-memcached with --purge. A look at the output of phpinfo() shows this line:

/etc/php/7.0/fpm/conf.d/25-memcached.ini

The memcached.so module has moved from /usr/lib/php/20151012 to /usr/lib/php/20160303

The answer might be to upgrade to PHP 7.1. Trying that now.

1 Answer 1

1

The answer is to upgrade to PHP 7.1. The Ubuntu upgrade only does a partial upgrade of PHP from 7.0 to 7.1 when upgrading from 17.04 zesty to 17.10 artful.

After upgrading all your PHP modules to 7.1:

Stop and disable PHP 7.0 FPM

sudo systemctl stop php7.0-fpm.service
sudo systemctl disable php7.0-fpm.service

Start PHP 7.1 FPM

sudo systemctl start php7.1-fpm.service

Remember to also fix your web server. For NGINX I had to change this line:

fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;

Then restart NGINX

sudo systemctl restart nginx.service
1
  • Had the same issue with Memcached when upgrading from php7.2fpm to php7.3fpm on ubuntu 18.04 with different PPA. This was also the solution.
    – Toto
    Feb 28, 2019 at 22:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .