Is Apc Compatible with PHP 5.4 or PHP 5.5

Is APC compatible with PHP 5.4 or PHP 5.5?

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

Is there a PHP 5.5 buildpack with APC (Alternative PHP Cache)?

To close things out: I used php-buildpack#v4.1.5 which includes apc though it's based on PHP 5.4 so I had to down-level my guzzle to 5.3.0 which meant I needed to modify my guzzle code since I was using the guzzle 6 apis. I then changed my Laravel cache calls to use apc. Surprisingly, after all that the app still works, though whether it's really any faster is hard to tell

Anyone successfully serving high traffic with PHP 5.4.4 and APC 3.1.10?

No. Tried it on a high-traffic site already. Segfaults badly on 3.1.10 about 75% of the time or more due to string corruption. The trunk version (as of 6/27/2012) is somewhat better but still too unstable for us for production.

See: https://bugs.php.net/bug.php?id=62442

Full alternative to APC user data cache for PHP?

If anyone is wondering what I have ended up doing - I use XCache now. It's surely not perfect - mainly because of its very weak (if any at all) documentation. But it's stable, maintained, and works as expected so it is pretty much good replacement of APC now.

What to use instead of apc user data cache in php 5.5?

Starting from PHP 5.5 the APC user data storage is packaged separately as PECL APCu.

  • Source code: http://pecl.php.net/package/APCu
  • MacOS homebrew package is php55-apcu (brew install php55-apcu)
  • Debian/ubuntu is called php5-apcu (apt-get install php5-apcu)
  • Fedora/RedHat is called php-pecl-apcu (yum install php-pecl-apcu)
  • Windows - use precompiled APCu dll - follow instructions provided in the answer below.

This allows you to use all user cache functions, such as apc_store(). It will also return true for extension_loaded('apc') - this means that all libraries depending on APC will work similarly to PHP 5.4.



Related Topics



Leave a reply



Submit