千家信息网

安装xcache

发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,前提php、php-fpm、mariadb等LAMP环境已经架设好1、安装xcachecd /usr/local/src #进入软件包存放目录wget http://xcache.lighttpd.n
千家信息网最后更新 2026年11月02日安装xcache

前提php、php-fpm、mariadb等LAMP环境已经架设好

1、安装xcache

cd /usr/local/src #进入软件包存放目录

wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz#下载

tar zxvf xcache-3.2.0.tar.gz #解压

cd xcache-3.2.0 #进入安装目录

/usr/bin/phpize #用phpize生成configure配置文件---------这里的目录,用which phpize来找

[root@lgq bin]# ln -sv phpize /usr/src/xcache-3.2.0

'/usr/src/xcache-3.2.0/phpize' -> 'phpize

[root@lgq xcache-3.2.0]# phpize

Configuring for:

PHP Api Version: 20100412

Zend Module Api No: 20100525

Zend Extension Api No: 220100525

[root@lgq xcache-3.2.0]#./configure --enable-xcache--enable-xcache-coverager --enable-xcache-optimizer --with-php-config=/usr/bin/php-config #配置

make #编译

make install #安装

安装完成之后,出现下面的界面,记住以下路径,后面会用到。/usr/lib64/php/modules/

/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/#xcache模块路径

2、创建xcache缓存文件

touch /tmp/xcache #创建文件

chmod 777 /tmp/xcache #设置权限

3、创建xcache管理员密码为123456

echo -n "123456" | md5sum #记住类似下面一行代码(md5加密之后的密码),后面会用到

c1820eeffb72ef4463aa2a67c65c7b0a

4、拷贝xcache后台管理程序到网站根目录

cp -r /usr/local/src/xcache-3.2.0/htdocs /var/www/html/xcache

chown apache.apache -R /var/www/html/xcache #设置xcache目录和网站目录权限相同

5、配置php支持xcache

vi /usr/local/php/etc/php.ini #编辑配置文件,在最后一行添加以下内容

[xcache-common]

extension = xcache.so

[xcache.admin]

xcache.admin.enable_auth = On

xcache.admin.user = "xcache"

xcache.admin.pass = "c1820eeffb72ef4463aa2a67c65c7b0a"

[xcache]

xcache.shm_scheme ="mmap"

xcache.size=60M

xcache.count =1

xcache.slots =8K

xcache.ttl=0

xcache.gc_interval =0

xcache.var_size=64M

xcache.var_count =1

xcache.var_slots =8K

xcache.var_ttl=0

xcache.var_maxttl=0

xcache.var_gc_interval =300

xcache.test =Off

xcache.readonly_protection = On

xcache.mmap_path ="/tmp/xcache"

xcache.coredump_directory =""

xcache.cacher =On

xcache.stat=On

xcache.optimizer =Off

[xcache.coverager]

xcache.coverager =On

xcache.coveragedump_directory =""

:wq! #保存退出

6、测试

service php-fpm restart#重启php-fpm

service nginx restart #重启nginx

浏览器打开网站根目录下面的xcache

输入用户名xcache 密码123456

可以看到如下界面

Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/xcache/cacher/index.phpon line 126Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/xcache/cacher/index.php on line 126

是因为时区的问题引起的

vim /etc/php.ini 去掉date.timezone前面的;号,后面上 Asia/Shanghai,就不会再提示错误信息了

date.timezone =Asia/Shanghai


目录 文件 配置 密码 网站 一行 权限 根目录 界面 路径 面的 管理 相同 代码 信息 内容 前提 后台 拷贝 时区 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 上海挚品互联网科技有限公司 上海睿民互联网科技有限公司 互联网金融 科技 互联网 科技创新 善班互联网科技有限公司 互联网科技公司做什么 互联网科技生活的内容 常德市电业局互联网科技部 互联网科技项目计划书材料类 上海宁丞科技互联网 昊天互联网科技有限公司 互联网科技公司有风险吗 互联网科技公司营业执照怎么办理 高科技互联网套路 互联网第三次科技革命特征 山东星卡互联网科技有限公司官网 黑云互联网科技有限公司 云南省自由互联网科技有限公司 上海万顺科技互联网有限公司招聘 三亚科技创新互联网基地 互联网与科技 互联网科技公司怎么样 广州互联网络科技有限公司 科技创新互联网企业 奇士达互联网科技 银川新华互联网科技职业技术培训学校图片 岳阳华臻互联网科技有限公司 互联网科技革命什么开始 企晟互联网信息科技有限公司 科技大学互联网
0