PHP memcache扩展模块安装

安装php扩展模块memcache
  memcache 的工作就是在专门的机器的内存里维护一张巨大的hash表,来存储经常被读写的一些数组与文件,从而极大的提高网站的运行效率,减轻后端数据库的读写压力。 
1、解压源码包
tar -zxvf memcache-2.2.3.tgz
2、使用php工具 生成memcahce的configure文件。
# 直接执行此命令
/usr/local/php/bin/phpize


注:没有生成configure 就安装autoconfig。
yum install -y autoconfig
3、编译memcache
./configure --with-php-config=/usr/local/php/bin/php-config

4、编译、编译安装

make && make install
解决方案:
vi memcache.c
将所有的:zend_list_insert(pool, le_memcache_pool);
改为:zend_list_insert(pool, le_memcache_pool TSRMLS_CC);
将所有的:zend_list_insert(mmc, le_pmemcache);
改为:zend_list_insert(mmc, le_pmemcache TSRMLS_CC);
讲所有的:if (!zend_is_callable(failure_callback, 0, NULL))
改为:if (!zend_is_callable(failure_callback, 0, NULL, NULL))
报zend_list_insert函数错误
查看.os文件目录

ls /usr/local/php/lib/php/extensions/no-debug-zts-20090626/
安装完成查看os文件

5、php内添加memcache模块

vim /usr/local/php/etc/php.ini

extension=memecache.so
/usr/local/php/bin/php -m | grep memcache

 

posted @ 2018-01-29 20:34  kevin.Xiang  阅读(170)  评论(0编辑  收藏  举报