2024年11月22日 星期五
通知

Windows Server 2008 R2 PHP5.6.18 开启 Xcache3.2.0

系统:windows server 2008 R2 64bit
IIS:7.5
PHP版本:PHP5.6.18
Xcache:Xcache 3.2.0
PHP下载:http://windows.php.net/download
Xcache下载:http://xcache.lighttpd.net/pub/Releases/3.2.0/
根据自己的PHP版本对应下载xcache版本,千万别下错xcache了,不然网站会提示无法加载xchache扩展

1、下载完Xcahce后解压,复制php_xcache.dll到PHP目录下的ext目录中
2、用Notepad++打开xcache.ini,从[xcache-common]开始复制内容到php.ini中

[xcache-common]
extension = php_xcache.dll
[xcache.admin]
xcache.admin.enable_auth = On
xcache.admin.user = "mOo"
xcache.admin.pass = "md5 encrypted password"
[xcache]
xcache.shm_scheme =        "mmap"
xcache.size  =               60M
xcache.count =                 1
xcache.slots =                8K
xcache.ttl   =                 0
xcache.gc_interval =           0
xcache.var_size  =            4M
xcache.var_count =             1
xcache.var_slots =            8K
xcache.var_ttl   =             0
xcache.var_maxttl   =          0
xcache.var_gc_interval =     300
xcache.var_namespace_mode =    0
xcache.var_namespace =        ""
xcache.readonly_protection = Off
xcache.mmap_path =    "/dev/zero"
xcache.coredump_directory =   ""
xcache.coredump_type =         0
xcache.disable_on_crash =    Off
xcache.experimental =        Off
xcache.cacher =               On
xcache.stat   =               On
xcache.optimizer =           Off
[xcache.coverager]
xcache.coverager =           Off
xcache.coverager_autostart =  On
xcache.coveragedump_directory = ""

注:我把注解删除了,看着眼顺,参数根据自己的情况修改
3、利用phpinfo.php打开看看是否真的开启xcache,看到如下信息说明xcache开启成功

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with XCache v3.2.0, Copyright (c) 2005-2014, by mOo
    with XCache Cacher v3.2.0, Copyright (c) 2005-2014, by mOo
    with XCache Coverager v3.2.0, Copyright (c) 2005-2014, by mOo

下面以xiuno bbs程序为例,这是xiuno官网提供的,当然你也可以用上面的,参数根据自己实际情况修改

[xcache-common]
extension = php_xcache.dll
[xcache]
xcache.shm_scheme =        "mmap"
xcache.size  =               20M
; set to cpu count (cat /proc/cpuinfo |grep -c processor)
xcache.count =                 1
xcache.slots =                80K
xcache.ttl   =                 0
xcache.gc_interval =           0
# 启用多大的缓存
xcache.var_size  =            40M
xcache.var_count =             1
# 启用多少个 key
xcache.var_slots =            80K
# 这里启用变量过期机制
xcache.var_ttl   =             1
xcache.var_maxttl   =          0
xcache.var_gc_interval =     300
xcache.readonly_protection = Off
; for *nix, xcache.mmap_path is a file path, not directory. (auto create/overwrite)
; Use something like "/tmp/xcache" instead of "/dev/*" if you want to turn on ReadonlyProtection
; different process group of php won't share the same /tmp/xcache
xcache.mmap_path =    "/dev/zero"
xcache.coredump_directory =   ""
xcache.experimental =        Off
xcache.cacher =               On
xcache.stat   =               On
xcache.optimizer =           Off

然后打开Xiuno BBS 3.0 修改 conf/conf.php,把mysql改成xcache

'cache' => array(
        'type' = >'xcache',
)

然后重启下IIS服务,即可

原创文章,转载请注明: 转载自荣耀博客
本文链接地址: Windows Server 2008 R2 PHP5.6.18 开启 Xcache3.2.0

关于 荣耀博客

好记性,不如烂笔头。

发表回复