我已经成功安装了 xcache。并在 php.ini 中添加 xcache 配置。并重新启动 apache 服务器。
我的系统是 mac os x 10.7.3。
php -v(或显示 phpinfo):
PHP 5.3.8 with Suhosin-Patch (cli) (built: Nov 15 2011 15:33:15)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Zend Debugger v5.2, Copyright (c) 1999-2009, by Zend Technologies
with XCache v2.0.0, Copyright (c) 2005-2012, by mOo
xcache 配置:
[xcache-common]
zend_extension = "/usr/lib/php/extensions/no-debug-non-zts-20090626/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 = 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.readonly_protection = Off
xcache.mmap_path = "/tmp/xcache"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
xcache.test = Off
xcache.experimental = Off
[xcache.coverager]
xcache.coverager = Off
xcache.coveragedump_directory = ""
一切看起来都不错。但是当我运行以下代码时,出现错误:致命错误:调用未定义的函数 xcache_isset()。
PHP代码:
<?php
if(!xcache_isset("test")) {
xcache_set("test", strftime('%Y-%m-%d %A %H:%M:%S', time()), 30);
}
echo xcache_get("test");
问题是由什么引起的?