如何将 memcache 的源代码切换为编译并为 drush 启用它?

How do I switch source of memcache to compile and for drush to enable it?

Ubuntu 14.04 LTS Drupal 7.43 PHP7.0

我看过其他帖子:

I switched to the https://github.com/rlerdorf/php-memcached.git, then I can successfully build the extension.

那么我如何实际切换到另一个 git 仓库来构建?

由于 php 7.0,我当前的内存缓存无法构建;以下错误:

sudo pecl install memcache
...
config.status: executing libtool commands
running: make
/bin/bash /tmp/pear/temp/pear-build-rootNtdeGS/memcache-2.2.7/libtool --  mode=compile cc -I/usr/include/php/20151012 -I. -I/tmp/pear/temp/memcache - DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootNtdeGS/memcache-2.2.7/include - I/tmp/pear/temp/pear-build-rootNtdeGS/memcache-2.2.7/main - I/tmp/pear/temp/memcache -I/usr/include/php/20151012 - I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM - I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext - I/usr/include/php/20151012/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c      /tmp/pear/temp/memcache/memcache.c -o memcache.lo
libtool: compile:  cc -I/usr/include/php/20151012 -I. - I/tmp/pear/temp/memcache  -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootNtdeGS/memcache-2.2.7/include -I/tmp/pear/temp/pear-build-rootNtdeGS/memcache-2.2.7/main -I/tmp/pear/temp/memcache -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -  I/usr/include/php/20151012/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c   /tmp/pear/temp/memcache/memcache.c  -fPIC -DPIC -o .libs/memcache.o
/tmp/pear/temp/memcache/memcache.c:40:40: fatal error:     ext/standard/php_smart_str.h: No such file or directory
 #include "ext/standard/php_smart_str.h"
                                    ^
compilation terminated.
make: *** [memcache.lo] Error 1
ERROR: `make' failed

使用 git 克隆:

git clone https://github.com/rlerdorf/php-memcached.git

cd into folder

phpize

./configure

make

make install