问题描述
我正在使用 APC 来缓存用户变量(通过apc_store/apc_fetch命令).我还通过选项"apc.enable_cli = 1"为CLI启用了APC.但是,PHP的CLI版本似乎访问与Apache使用的版本不同的APC缓存.
I'm using APC to cache user variables (with the apc_store/apc_fetch commands). I've also enabled APC for the CLI with the option "apc.enable_cli = 1". However, the CLI version of PHP seems to access a different APC cache from the version used by Apache.
是否可以将APC配置为对CLI和Web调用使用相同的缓存?
Is it possible to configure APC to use the same cache for both CLI and web invocations?
推荐答案
不可能..完成类似您所要询问的事情的唯一方法是使用诸如memcacheD之类的东西.或运行您需要通过网络服务器运行的内容.什么正在运行的CLI不能通过带有cronjob的Web脚本运行?
Not possible.. The only way to accomplish something like what your asking is to use something like memcacheD. Or run what you need to run through your webserver. What's running CLI that you cannot run via a web script with a cronjob?
这篇关于在CLI和Web上调用时,如何使PHP使用相同的APC缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!