我在缓存 SimpleXMLElement 对象数组时遇到了困难。失败的是 apc_store 行,我不知道为什么。
程序在这一行终止,这很奇怪,因为我在其他地方使用过——将数组包装在 ArrayObject 中并将其存储在缓存中。
我的代码摘录如下:
$feed = /* some url */
$xml = simplexml_load_file($feed);
$items = $xml -> xpath('/rss//item');
foreach($items as $item){
$item -> addChild('myTag1', "My Tag 1");
$item -> addChild('myTag2', "My Tag 2");
}
apc_store($feed, new ArrayObject($items), 60);
我不认为我的日志文件工作正常,这是最后一个条目,以防万一它有帮助,但我认为这与 SSL 有关,在这里没有帮助:
[Wed Feb 20 12:21:51 2013] [notice] caught SIGTERM, shutting down
Attempt to free unreferenced scalar: SV 0x7fe7805e2130, Perl interpreter: 0x7fe7805ea4f0 during global destruction.
[Wed Feb 20 12:21:54 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Feb 20 12:21:54 2013] [notice] SSL FIPS mode disabled
Attempt to free unreferenced scalar: SV 0x7f94bfa75ec0, Perl interpreter: 0x7f94bfa56550 during global destruction.
[Wed Feb 20 12:21:57 2013] [notice] Digest: generating secret for digest authentication ...
[Wed Feb 20 12:21:57 2013] [notice] Digest: done
[Wed Feb 20 12:21:59 2013] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Wed Feb 20 12:21:59 2013] [notice] mod_python: using mutex_directory /tmp
[Wed Feb 20 12:21:59 2013] [notice] SSL FIPS mode disabled
[Wed Feb 20 12:21:59 2013] [notice] Apache/2.2.22 (Unix) DAV/2 PHP/5.4.10 mod_python/3.3.1 Python/2.7.3 mod_ssl/2.2.22 OpenSSL/1.0.0j-fips mod_perl/2.0.5 Perl/v5.14.3 configured -- resuming normal operations
感谢你的帮助。