联系站长! 傻子-跸西blog 傻子-跸西微blog
顶部

底部
Feed on
Posts
Comments

服务器总要优化一下你的网站打开速度才会更快一些!

1、安装xcache

wget http://xcache.lighttpd.net/pub/Releases/1.3.2/xcache-1.3.2.tar.gz

tar -zxvf xcache-1.3.2.tar.gz

cd xcache-1.3.2

yum -y install php53-devel

phpize

./configure --enable-xcache

make

make install 

2、配置xcache
方法一:
打开php.ini文件,增加如下代码
[xcache-common]
; change me - 64 bit php => /usr/lib64/php/modules/xcache.so
; 32 bit php => /usr/lib/php/modules/xcache.so
zend_extension = /usr/lib/php/modules/xcache.so

[xcache.admin]
xcache.admin.auth = On
xcache.admin.user = "mOo"
; xcache.admin.pass = md5($your_password)
xcache.admin.pass = ""

[xcache]
xcache.shm_scheme =        "mmap"
xcache.size  =               32M
xcache.count =                 1
xcache.slots =                8K
xcache.ttl   =              3600
xcache.gc_interval =         300

; Same as aboves but for variable cache
; If you don't know for sure that you need this, you probably don't
xcache.var_size  =            0M
xcache.var_count =             1
xcache.var_slots =            8K
xcache.var_ttl   =             0
xcache.var_maxttl   =          0
xcache.var_gc_interval =     300

; N/A for /dev/zero
xcache.readonly_protection = Off

xcache.mmap_path =    "/dev/zero"

xcache.cacher =               On
xcache.stat   =               On 

方法二:

# cd /etc/php.d
# vi xcache.ini

然后按”Insert”编辑
将上面第一步的内容粘贴进去
然后 按”ESC”键
再按 “:”
输入wq 保存

重启康乐就OK了 查看是否加载 在命令行输入 php -v 显示 with xcache 即可

有什么想法,说两句吧