xcache给php加速
时间:2016-07-14 13:10 来源:linux.it.net.cn 作者:IT
说明:
php安装目录:/usr/include/php
php.ini配置文件路径:/etc/php.ini
apache安装目录:/etc/httpd/
网站根目录:/var/www/html
1、安装xcache
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配置文件
./configure –enable-xcache–enable-xcache-coverager –enable-xcache-optimizer –with-php-config=/usr/bin/php-config #配置
make #编译
# make install
Installing shared extensions: /usr/lib64/php/modules/
2、创建xcache缓存文件
touch /tmp/xcache #创建文件
chmod 777 /tmp/xcache #设置权限
3、创建xcache管理员密码为123456
e# echo -n “123456” | md5sum
e10adc3949ba59abbe56e057f20f883e
4、拷贝xcache后台管理程序到网站根目录
cp -r /root/xcache-3.2.0/htdocs /var/www/html/xcache
chown www.www -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 = “e10adc3949ba59abbe56e057f20f883e”
[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 apache restart #重启php-fpm
浏览器打开网站根目录下面的xcache
输入用户名xcache 密码123456
http://www.osyunwei.com/archives/8918.html
http://www.fomore.net/os/?p=535
(责任编辑:IT)
说明: php安装目录:/usr/include/php php.ini配置文件路径:/etc/php.ini apache安装目录:/etc/httpd/ 网站根目录:/var/www/html
1、安装xcache 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配置文件 ./configure –enable-xcache–enable-xcache-coverager –enable-xcache-optimizer –with-php-config=/usr/bin/php-config #配置 make #编译
# make install 2、创建xcache缓存文件 touch /tmp/xcache #创建文件 chmod 777 /tmp/xcache #设置权限 3、创建xcache管理员密码为123456
e# echo -n “123456” | md5sum 4、拷贝xcache后台管理程序到网站根目录 cp -r /root/xcache-3.2.0/htdocs /var/www/html/xcache chown www.www -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 = “e10adc3949ba59abbe56e057f20f883e” [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 apache restart #重启php-fpm 浏览器打开网站根目录下面的xcache 输入用户名xcache 密码123456 http://www.osyunwei.com/archives/8918.html http://www.fomore.net/os/?p=535 |