centos7安装memcached以及phpmemcached扩展

1.安装memcached:
yum -y install memcached

2.设置memcached开机启动:
chkconfig memcached on

3.立即启动memcached服务:
service memcached start

4.查找memcached安装位置:
rpm -ql memcached

5.查看memcached配置文件:
cat /etc/sysconfig/memcached

6.执行
netstat -tunlp | grep memcached
看到11211端口,说明memcached安装成功

7.安装libmemached:
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
tar -zxvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18/
./configure --prefix=/usr/lib/libmemcached
make && make install

8.下载memcache扩展包并安装:
wget http://pecl.php.net/get/memcache-2.2.7.tgz
tar -zxvf memcache-2.2.7.tgz
cd memcache-2.2.7
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config
(如果失败重新来换作)
./configure --enable-memcache --with-php-config=/usr/bin/php-config --with-zlib-dir

make && make install

修改php文件 vi /etc/php.ini
添加extension = memcache.so

重启 apache
systemctl restart httpd.service #重启apache

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容