ubuntu 安装memcache

本文详细介绍如何在Linux环境下安装Memcached及PHP的memcache模块,并配置memcache.ini以启用缓存服务。此外,还提供了查找memcache.so文件路径的方法及验证配置是否生效的方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

memcached 安装
sudo apt-get install memcached

 

 

-m 指定使用多少兆的缓存空间;-p 指定要监听的端口; -u 指定以哪个用户来运行

安装php-memcache模块
sudo apt-get install php5-memcache

 

编辑配置文件
sudo vi /etc/php5/conf.d/memcache.ini
;uncomment the next line to enable the module
extension=memcache.so

通过命令 find / -name memcache.so 来查找 memcache.so在什么位置,写入上面的位置

[memcache]
memcache.dbpath="/var/lib/memcache"
memcache.maxreclevel=0
memcache.maxfiles=0
memcache.archivememlim=0
memcache.maxfilesize=0
memcache.maxratio=0


在phpinfo()查看memcache的相关配置

转载于:https://www.cnblogs.com/dcj890828/articles/4740464.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值