According to a Linux Adminstrator over at Hostgator:

With PHP 5.3 having APC installed is not needed as PHP 5.3 already has improvements that APC does resolve in it.

Is that statement actually accurate? Does installing APC (Alternative PHP Cache) give any performance improvements with PHP 5.3?

I questioned this statement and a different admin defended it by:

the official word we have from our upper tier administrators is to avoid APC as PHP 5.3+ has improved from previous versions such that APC can potentially become redundant or even conflicting

Am I being tossed around here or is this statement valid? This issue was discussed with Hostgator in regards to installing APC on their Level 7 VPS.

  • PHP 5.3 doesn't add an opcode cache to the language. The actual reason is probably just that it's a bit difficult adding APC to shared hosting. serverfault.com/questions/179081/… That your host gives you a BS answer instead of a perfectly valid reason is a bad, bad sign. – ceejayoz Apr 27 '13 at 22:22
  • @ceejayoz When I was discussing installing APC with them, it was for a Level 7 VPS. – Ch-C Apr 27 '13 at 22:25
  • 5
    Here's a PHP 5.4 benchmark with and without APC. ricardclau.com/2013/03/… I can't prove a negative - ask for what exactly got added to PHP 5.3 that replaces the need for an opcode cache. I imagine they'll have a hard time showing something. Again, they're bullshitting you. APC and Memcached will both give you performance improvements, and if you're having capacity issues you're likely to benefit from both in concert. – ceejayoz Apr 27 '13 at 22:35

The purpose of APC is to provide:

  • opcode cache (in a nutshell - saving compiled PHP code to memory for reuse/performance)
  • data store (providing API for PHP code to persistently store and retrieve data to/from memory)

PHP 5.3 release, while being important release in general, has no such functionality natively.

Upcoming PHP 5.5 is planned to integrate Zend Optimizer for opcode cache (but no data store).

There might be configuration, security, resource consumption and other considerations to advise against APC in specific cases.

However implying that PHP 5.3 somehow has replacement functionality and has no need for opcode caching (APC or other) is blatantly incorrect.

So the very first thing you should do, if you haven't already, is to install opcode cache.

Rasmus Lerdorf (creator of PHP)

Digg Technical Talks - PHP Performance 00:17:21

  • Hostgator admin responds to this issue once reading this question with: "I have consulted with one of our upper tier administrators on this issue, and it would appear that our internal documentation on APC was not as clear as it should be. Our documentation is meant to instruct us to discourage recommending opcode caching because it acts as a sort of bandaid for poorly performing PHP code rather than addressing the underlying issue. You are correct that APC is not made unnecessary by PHP 5.3, and that it can provide performance improvements for sites even in a PHP 5.3 environment; however..." – Ch-C Apr 29 '13 at 15:09
  • "...optimizing your PHP code and using object caching (e.g. memcached) is a better long-term solution than opcode caching (APC). The actual compilation of PHP code should not be the bottleneck in your site's performance. Opcode caching (APC) is used for caching pre-compiled PHP code, whereas object caching (memcached) is used for caching actual data used by the code. Object caching can allow for better performance in the use and re-use of data by your web sites, whereas opcode caching will essentially allow your code to start executing faster." – Ch-C Apr 29 '13 at 15:10
  • 2
    Added quote by Rasmus Lerdorf about how bandaid opcode is. Hostgator can go tell him their thoughts on PHP and I suggest you stop wasting time on this. :) – Rarst Apr 29 '13 at 17:08
  • So their answer is basically "sorry, we were BSing you, so here's some more unsupported BS". Hostgator's definitely on my "never use" list now. – ceejayoz Apr 29 '13 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.