php安装memcached模块
1·安装libmenmcached
-
1·下载libmenmcached包 然后解压
tar zxvf libmenmcached-xxx
./configure --prefix=/usr/local/libmemcached --with-memcached
报错:
Paste_Image.png
报这个 c错误是gcc与gcc-c++模块没装
yum install -y gcc gcc-g++
等没错后执行:make && make install
2·安装memcached模块
-
1·下载memcached包,解压后发现没有./configure
解决方案:
找到php路径 然后执行 /xx/php/bin/phpize -
2·报错1:
解决的办法是安装autoconf 这个包
然后
./configure --enable-memcached --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached
- 3·报错2:
解决方法:用yum查询完后再安装
yum search re2c
yum search zlib
- 4·报错3:
configure: error: no, libmemcached sasl support is not enabled. Run configure with --disable-memcached-sasl to disable this check
又得:
yum search sasl
我这是什么都装了
yum install libgsasl-devel.x86_64 cyrus-sasl-devel.x86_64 php-pear-Auth-SASL.noarch saslwrapper-devel.x86_64 -y
- 5·报错4
configure: error: no, libmemcached sasl support is not enabled. Run configure with --disable-memcached-sasl to disable this check
解决方法:在./configure xxx 后面加上 --disable-memcached-sasl 这就解决了 是不是很囧。
./configure --enable-memcached --with-php-config=/xx/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl
- 6·最后:
make && make install
vim /xxx/local/php/lib/php.ini
加上extension=memcached.so重起一下服务就可以了。没有这一步 php -m是看不到memcache的模块的。 但是你会在/xx/php/moudles 下看到memcache
这个模块。
3·安装memcache
yum searche memcache
yum install memcached.x86_64 -y
- 1·然后起进程:
/etc/ini.d/memcached start
但当你ps查看进程的时候发现没有memcache的任何进程。 - 2·解决方案:
vim /etc/init.d/memcached
添加监控。 ps就可以看到了
daemon --pidfile ${pidfile} memcached -l 10.21.182.183 -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P ${pidfile} $OPTIONS
网友评论