#PHP增加memcache支持(官司网memcache-3.0.8暂时不支持PHP的编译)
官网memcache-3.0.8在编译的时候出现“php-smart_str.h”没有找到的错误!
但是我们可以在github里面找到pecl-memcache支持PHP7的分支,请按以下操作即可完成memcache中扩展安装
[root@centos7 memcached]
# cd /usr/local/src/php-7.1.9/ext
# 如果已经安装git忽略yun install git
[root@centos7 memcached]
# yum install git
[root@centos7 ext]
# git clone https://github.com/websupport-sk/pecl-memcache memcache
[root@centos7 ext]
# cd memcache
[root@centos7 ext]
# yum install autoconf
[root@centos7 ext]
# /usr/local/php/bin/phpize
[root@centos7 ext]
# ./configure --with-php-config=/usr/local/php/bin/php-config
[root@centos7 ext]
# make && make install
#修改php.ini
[root@centos7 ext]
# vi /usr/local/php/etc/php.ini
# 在 Dynamic Extensions 代码块中添加如下扩展
extension=
/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/memcache
.so
[root@192 local]# /usr/local/php/sbin/php-fpm -m|grep memcache
memcache
有问题请加博主微信进行沟通!
全部评论