如何切换memcache源以进行编译和drush启用它?

时间:2016-05-04 14:07:50

标签: drupal memcached

Ubuntu 14.04 LTS Drupal 7.43 PHP 7.0

我在其他帖子中读到:

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

那么我该如何切换到其他git repo来构建?

由于php 7.0,我当前的memcache无法构建;错误如下:

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

1 个答案:

答案 0 :(得分:1)

使用git clone:

  

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

     

cd into folder

     

phpize

     

./configure

     

make

     

make install