且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

APC 是否与 PHP 5.4 或 PHP 5.5 兼容?

更新时间:2023-12-05 10:14:04

PHP 5.5 中包含的 Zend OPCache

2013 年 3 月 21 日,PHP 5.5 beta 1 发布包括Zend OPCache" - 看起来这将是未来 APC 的替代品,因为它包含在 PHP 核心中,并且必须为每个新版本维护.

我个人建议那些依赖 APC 的操作码缓存的人使用即将推出的内置操作码缓存测试他们的代码,并反馈遇到的任何问题以确保稳定的最终版本.

我不知道这对 APC 的未来意味着什么.

PHP 5.4+ 的 APC 仍标记为测试版

这意味着开发人员认为它完全稳定.虽然许多人在使用当前的 SVN 版本时根本没有遇到任何问题,但仍然有一些人在某些配置下或在重负载下出现边缘情况的奇怪报告.

对于您想在生产环境中使用的所有内容,请确保首先在开发或预生产环境中彻底测试任何版本(测试版稳定版).这包括负载测试!

从 3.1.13 版本开始,提交到 SVN 存储库的速度有所放缓,错误列表 没有那么多最近添加的内容.做你想做的.

2012 年 12 月 10 日 21:05,Rasmus Lerdorf 写道:

APC 现在是 5.4,我认为没有比 5.3 中更多的边缘情况了.两者都不是完美的,但对于大多数网站来说已经足够接近了.

任何有 C/gdb 技能和一些空闲时间的人都被要求掩盖 错误列表,看看他们是否可以修复任何问题,或者改进这个免费开源产品我们都依赖.

存在替代解决方案,***提供了一个PHP 加速器列表.

2013 年 2 月 13 日,Zeev Suraski 宣布 Zend Optimizer+ 源代码的可用性.

关于将 Zend Optimizer+ 集成到PHP core 在下一个主要版本(5.5 之后的版本).如果是这种情况,人们可能希望提前熟悉 Zend Optimizer+.

不要使用 APC 3.1.14

APC 3.1.14 已从 PECL 中删除由于一些已发现但尚未追踪到的严重内存问题而导致下载.

如果您已经在使用 3.1.14,您可能希望降级,直到 3.1.15 发布.请记住,这仍然是测试版.如果您正在使用它,则使用它的风险由您自己承担.

2013-01-02:
APC 3.1.14 可用添加 PHP 5.5 兼容性,此外还解决了相当多的其他错误.

仍是测试版

2012-09-03:
APC 3.1.13 可用,修复了一些段错误.

2012-08-16:
APC 3.1.12 标签已创建,但仍标记为 beta,可在 APC PECL 页面,以及变更日志.上>
这次修复了许多与 bin_dump 相关的错误.

2012-07-19:
APC 3.1.11 标签已创建,但仍标记为 beta,可在 APC PECL 页面,以及 changelog.我一直在关注相关的邮件列表,他们仍在积极致力于修复 APC 错误,但它是一个复杂的模块,似乎没有多少人能够胜任这项任务.此版本修复了包含文件时令人讨厌的 stat=0 错误.

2012-04-11:
今天创建了一个 APC 3.1.10 标签APC PECL 页面

changelog 指出:>

  • 添加 PHP 5.4 支持(Dmitry、Anatoliy、Pierre)
  • 修复错误 #22679:修复常量的 apc_bin_dump.使用 IS_CONSTANT_TYPE_MASK 处理所有的常量,包括不合格的(而不是 ~IS_CONSTANT_INDEX 检查)
  • 修正错误 #23822,php 在 apache 重启时崩溃

It doesn't seem like APC has been updated to coincide with the php 5.4 release (I wish they would have included APC in PHP core like originally planned).

I can't seem to find any definitive answer to whether current APC works with php 5.4+. I managed to find Ubuntu packages for php 5.4, but php-apc packages won't install.

Zend OPCache included in PHP 5.5

On the 21st March 2013, the PHP 5.5 beta 1 was released including "Zend OPCache" - It looks firmly like this will be the replacement for APC going forward as it is included in the PHP core, and will have to be maintained for each new release.

I would personally advise those who depend on APC for it's opcode caching to test their code with the upcoming built-in opcode cache, and feed back any issues encountered to ensure a stable final release.

I do not know what this means for the future of APC.

APC FOR PHP 5.4+ IS STILL FLAGGED AS BETA

This means the developers do not consider it completely stable. While many people are experiencing no problems at all with the current SVN releases, there is still the odd report of edge cases from people under certain configurations, or under heavy load.

As with everything you would want to use in a production environment, make sure you thoroughly test any release (beta or stable) in development or pre-production environments first. This includes load testing!

As of the 3.1.13 release, commits to the SVN repository have slowed down somewhat and the bug list doesn't have that many recent additions. Make of that what you will.

On 10 December 2012 21:05, Rasmus Lerdorf wrote:

APC is at the point now for 5.4 where I don't think there are any more edge cases than we have in 5.3. Neither is perfect, but it is close enough for the majority of sites.

Anyone with C / gdb skills and some free time is urged to gloss over the bug list and see if they can fix anything, or improve this free open source product that we all rely on.

Alternative solutions exist, Wikipedia provides a list of PHP accelerators.

On the 13th of February 2013, Zeev Suraski announced the availability of the Zend Optimizer+ source code.

There has been quite a lengthy discussion about integrating Zend Optimizer+ into the PHP core in the next major version (the version after 5.5). People may wish to familiarise themselves with Zend Optimizer+ in advance, should this be the case.


Do not use APC 3.1.14

APC 3.1.14 has been removed from PECL downloads due to some serious memory issues that have been discovered but have not yet been tracked down.

If you're already using 3.1.14, you may wish to downgrade until 3.1.15 is released. Remember, this is still beta. If you are using it at all, you are using it at your own risk.

2013-01-02:
APC 3.1.14 is available, adding PHP 5.5 compatibility, in addition to resolving a fair number of other bugs.

Still beta


2012-09-03:
APC 3.1.13 is available, fixing a number of segfaults.


2012-08-16:
An APC 3.1.12 tag has been created, but is still marked as beta, its available on the APC PECL page, as well as the changelog.

Lots of bin_dump related bugs fixed this time around.


2012-07-19:
An APC 3.1.11 tag has been created, but is still marked as beta, its available on the APC PECL page, as well as the changelog. I've been following the relevant mailing lists, and they are still actively working on fixing APC bugs however it is a complex module and not many people seem to be up to the task. This release fixes the nasty stat=0 bugs when including files.


2012-04-11:
An APC 3.1.10 tag was created today, and a beta release of 3.1.10 was placed on the APC PECL page

The changelog states:

  • Add PHP 5.4 support (Dmitry, Anatoliy, Pierre)
  • Fixed bug #22679: Fix apc_bin_dump for constants. Use IS_CONSTANT_TYPE_MASK to handle all the constants, including the unqalified ones (instead of ~IS_CONSTANT_INDEX check)
  • Fixed bug #23822, php crashes on apache restart