设为首页 收藏本站
查看: 2331|回复: 0

[经验分享] 安装xcache

[复制链接]
累计签到:2 天
连续签到:1 天
发表于 2016-1-29 08:27:55 | 显示全部楼层 |阅读模式
前提php、php-fpm、mariadb等LAMP环境已经架设好

1、安装xcache
cd /usr/local/src #进入软件包存放目录
tar zxvfxcache-3.2.0.tar.gz #解压
cd xcache-3.2.0 #进入安装目录
/usr/bin/phpize #用phpize生成configure配置文件---------这里的目录,用which phpize来找

[iyunv@lgq bin]# ln -svphpize /usr/src/xcache-3.2.0
‘/usr/src/xcache-3.2.0/phpize’-> ‘phpize
Configuring for:
PHP Api Version:         20100412
Zend Module ApiNo:      20100525
Zend Extension ApiNo:   220100525

[iyunv@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
可以看到如下界面
wKioL1ap1iWzLC_ZAAEghuc8Jwc621.jpg

Warning: phpinfo(): It is not safe to rely on the system'stimezone settings. You are *required* to use the date.timezone setting or thedate_default_timezone_set() function. In case you used any of those methods andyou are still getting this warning, you most likely misspelled the timezoneidentifier. We selected the timezone 'UTC' for now, but please setdate.timezone to select your timezone. in /var/www/html/xcache/cacher/index.phpon line 126Warning: phpinfo(): It is notsafe to rely on the system's timezone settings. You are *required* to use thedate.timezone setting or the date_default_timezone_set() function. In case youused any of those methods and you are still getting this warning, you mostlikely misspelled the timezone identifier. We selected the timezone 'UTC' fornow, 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


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-170868-1-1.html 上篇帖子: xcache:php缓存扩展安装配置 下篇帖子: 安装xcache3.1.2,为php加速
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表