douxing8323 2012-12-05 10:24
浏览 25
已采纳

PHP APC无法使用密钥中的某些字符?

I have a few test installments of zend server CE (php5.3), one on Mac 10.8.2, one on Linux EC2 instance, both using the default APC implementation (zend data cache) that comes with the installation.

On both machines, I call:

apc_store("Installation:1234:lastActivity", "x", 120);

Then I call apc_fetch for that key.
On the Mac, apc_fetch works.
On the Linux, apc_fetch returns FALSE and fails.

Now for the weird stuff on the Linux box, a few tests I made:
1. If I remove the last char in the key (y), apc_fetch works.
2. If I change the colon (:) to slash (/), apc_fetch works.

Any ideas what is going on? thanks...

  • 写回答

1条回答 默认 最新

  • douyi6755 2012-12-05 11:00
    关注

    The Zend Server doesn't actually use APC, instead using it's own implementation - the "Zend Data Cache". There appear to be some subtle differences between them.

    One thing that the ZDC has is 'namespaces', where you prefix a key with a '{name}::', and then you can remove all keys that start with that prefix.

    It may be that there is a bug when there are two (non consecutive) colons in the string. In the meantime, it's easy enough to simply tweak the structure of the key to avoid the problem.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA
  • ¥20 csv格式数据集预处理及模型选择
  • ¥15 部分网页页面无法显示!
  • ¥15 怎样解决power bi 中设置管理聚合,详细信息表和详细信息列显示灰色,而不能选择相应的内容呢?
  • ¥15 QTOF MSE数据分析
  • ¥15 平板录音机录音问题解决
  • ¥15 请问维特智能的安卓APP在手机上存储传感器数据后,如何找到它的存储路径?