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.

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

报告相同问题?

悬赏问题

  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据