FreeBSD: Install PHP xcache Opcode Cacher

2009-05-13 15:22:59来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


Q.How do I install and configure
[url=javascript:;]xcache[/url]
under
[url=javascript:;]FreeBSD[/url]
operating systems for
[url=javascript:;]Apache[/url]
,
[url=javascript:;]lighttpd[/url]
or ngnix web server?
[/url]
A.XCache is a fast, stable
[url=javascript:;]php
opcode cacher that has been tested and now running on production server under high load.
[/url]
FreeBSD install xcache
xcache can be installed using FreeBSD
[url=javascript:;]ports
system or pkg_add command itself. First, update ports tree:
# portsnap fetch update
Install xcache, enter:
# cd /usr/ports/www/xcache
# make install clean
Enable xache
To enable xcahce copy the /usr/local/share/examples/xcache/xcache.ini config file into /usr/local/etc/php/ and modify it to suit your needs, enter:
# cp /usr/local/share/examples/xcache/xcache.ini /usr/local/etc/php/
# cd /usr/local/etc/php/
# vi xcache.ini
Set xcache.size and other parameters as per your requirements. Here is my sample xcache for FreeBSD 7 with quad core CPU and 4GiG RAM:
[xcache-common]
extension = xcache.so

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

[xcache]
; ini only settings, all the values here is default unless explained

; select low level shm/allocator scheme implemenation
xcache.shm_scheme =        "mmap"
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
xcache.size  =               512M
; set to cpu count (cat /proc/cpuinfo |grep -c processor)
xcache.count =                 4
; just a hash hints, you can always store count(items) > slots
xcache.slots =                8K
; ttl of the cache item, 0=forever
xcache.ttl   =                 0
; interval of gc scanning expired items, 0=no scan, other values is in seconds
xcache.gc_interval =           0

; same as aboves but for variable cache
xcache.var_size  =            128M
xcache.var_count =             1
xcache.var_slots =            8K

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:dig 命令的基本用法

下一篇:FreeBSD Configure Apache PHP with mod_fastcgi Modu