Linux安装PHP加速器Xcache
XCache 是一个又快又稳定的 PHP opcoolcode 缓存器. 经过良好的测试并在大流量/高负载的生产机器上稳定运行. 经过(在linux 上)测试并支持所有现行 PHP 分支的最新发布版本, 如 PHP_4_3 PHP_4_4 PHP_5_0 PHP_5_1 PHP_5_2 HEAD(6.x), 并支持线程安全/Windows. 与同类 opcoolcode 缓存器相比更胜一筹, 比如能够快速跟进 PHP 版本.下面介绍如何安装配置。
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
- 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/lib64/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
注意修改zend_extension = /usr/lib64/php/modules/xcache.so为正确的路径。
详情的配置说明:http://xcache.lighttpd.net/wiki/XcacheIni
转载请标明文章来源:《https://www.centos.bz/2011/10/linux-install-php-accelerator-xcache/》
时间: 2024-10-12 13:07:43