HOPE 发表于 2015-9-30 21:26

Centos 7 安装memcache及PHP扩展

yum install -y memcached
wget http://pecl.php.net/get/memcache-3.0.8.tgz
tar zxvf memcache-3.0.8.tgz
cd memcache-3.0.8
/usr/bin/phpize
./configure--with-php-config=/usr/bin/php-config --enable-memcache --with-zlib-dir
make && make install

到/etc/php.d/下建立memcache.ini,内容:
; Enable memcache extension module
extension=memcache.so

systemctl start memcached
systemctl enable memcached
systemctl restart nginx
systemctl restart php-fpm

即可在phpinfo中看到memcache了。

编译时如遇到错误信息:Can't find PHP headers in /usr/include/php
则:yum -y install php-devel

如遇:configure: error: no acceptable C compiler found in $PATH,是gcc编译器没有安装:
yum -y install gcc

如遇:memcache_pool.c:26:18: fatal error: zlib.h: No such file or directory
则:yum -y install zlib zlib-devel

HOPE 发表于 2015-9-30 21:26

发这个帖子做个纪录。

rainyxia 发表于 2015-10-4 03:11

老大可真懒.
memcached直接yum了. memcache这都没多少人用了还编译半天.

lipengit 发表于 2015-12-11 07:59

http://www.ibmnb.com//mobcent//app/data/phiz/default/01.png

xman981 发表于 2015-12-13 17:56

rainyxia 发表于 2015-10-4 03:11 static/image/common/back.gif
老大可真懒.
memcached直接yum了. memcache这都没多少人用了还编译半天.

老大也是玩http://www.ibmnb.com//mobcent//app/data/phiz/default/03.pnghttp://www.ibmnb.com//mobcent//app/data/phiz/default/03.png
页: [1]
查看完整版本: Centos 7 安装memcache及PHP扩展