André Figueira

Systems engineer - I write apps, I make websites, opinions are my own...

How to install memcached for Ubuntu when using phpbrew

When using PHPbrew you might sometimes need memcached, there is an error that happens when you try and install it with the following command:

phpbrew ext install memcached stable -- --disable-memcached-sasl

The error appears such as:

===> Configuring...
Error: Command failed: ./configure '--disable-memcached-sasl' --with-php-config=/home/afigueira/.phpbrew/php/php-7.2.0/bin/php-config >> /home/afigueira/.phpbrew/build/php-7.2.0/ext/memcached/build.log 2>&1 returns:

To solve this, make sure you have libmemcached installed on Ubuntu.

sudo apt-get install libmemcached-dev

Hope this helps anyone that gets stuck with this error!