1

The command apt-get install php-memcached will be installing php7.0.

Is there any way to install memcahed extension with php7.1?

Dani
  • 511
  • 2
  • 10
  • 21
  • 1
    Did you install PHP 7.1 via `apt-get` or something different? – ceejayoz Mar 24 '17 at 12:31
  • apt-get it was.. – Dani Mar 24 '17 at 13:00
  • Debian Jessie doesn't have PHP 7.1 packages. https://wiki.debian.org/PHP#Available_versions Did you add an additional repository like https://www.colinodell.com/blog/2016-12/installing-php-7-1 suggests? – ceejayoz Mar 24 '17 at 13:01
  • the sid repository – Dani Mar 24 '17 at 13:04
  • 1
    Then the package name would probably be something like `php7.1-memcached`. If that doesn't exist, you may need to use PECL. http://php.net/manual/en/memcached.installation.php – ceejayoz Mar 24 '17 at 13:06

1 Answers1

3

You need to compile php extension from source . IIRC there is no apt-get method is available yet.

install required libraries

sudo apt-get install libmemcached-dev libmsgpack-dev libmsgpackc2 zlib1g-dev php7.1-dev

then compile extension

git clone --depth 1 https://github.com/php-memcached-dev/php-memcached.git
cd php-memcached
phpize
./configure
make
sudo mv modules/ /usr/local/memcached/

and then enable that in your php.ini file append at the end as

extension=/usr/local/memcached/memcached.so

then restart.

shameless plug
I wrote a detailed blog post on memcached and php7.1 for Ubuntu/Debian https://www.computersnyou.com/5828

Steen Schütt
  • 423
  • 3
  • 14
Alok Yadav
  • 31
  • 3