Setup Issue: APC not working

Hi folks,

I’ve recently tried to install a Phabricator instance in my lab. But I don’t get the APC Cache part running.

Im running Phabricator on a new CentOS7 system. Do I have to install the APC or APCu PHP extension? - I see both enabled in php -i Ist there a detailed manual anywhere or someone who could help?

System Details

  • php-5.4
  • httpd-2.4.6
  • mariadb-server-5.5.52

2017-09-14 11_09_35-Clipboard

APC Installation Steps


APCu is not the same as APC, although the two provide the same interface. APCu is, in fact, APC without the opcode cache, which is the part that dramatically speeds up code execution.

If Phabricator detects APCu and not APC, it tells you that APC is not installed, which can be misleading if you don’t understand that APCu is not truly a drop-in replacement for APC.

PHP 5.6 and have a built-in opcode cache, which makes this a non-issue. If you can upgrade PHP, that’s probably the best course of action. Otherwise, you need to look into getting the actual APC extension installed and enabled on your system.

1 Like

I’ve verified that disabling APCu and then following this guide to get APC installed resolves the issue.

Great! Did you install APC with the pecl command or did you find a valid php-pecl-apc rpm package? I’m asking beacause on my system there is no php-pecl-apc rpm in the cetnos repos or epel.

So I followed the pecl install apc way and managed to got it running in a simple vhost. But phabricator is still complaining about the missing apc…

I ended up tangled in knots with this at the start of the year before Phabricator started supporting PHP 7(.1) … I used Remi’s PHP7 repo to achieve this.

The issue I had was that there was a chain of dependencies based around the default 5.4 CentOS install that work something like this …

OpCache requires PHP 5.5 minimum to run, so you need to get a 5.6 to run that.
Once you have 5.6 installed you then need APCu 5.1.4 (maximum) in order to be able to run it, because after that 5.6 is deprecated as its out of support (except security patches) and current versions only support PHP 7.

I ended up in a “sweet” spot of
PHP 5.6
APCu 5.1.4
Zend OpCahce 7.0.5

and that worked okish for a couple of months, primarily because APCu kept causing Apache errors and it would survive 5-7 days before flat out bombing the server. As soon as Phabricator moved to PHP 7.1 I ditched all those legacy versions and moved straight up.

I would really recommend doing the same to save you from pain later on.

Thanks for your advice!

I’m still running Phabricator on a centos7 with native php5.4 and no php caching at all. I’m fine with it because there only 10-20 users working with my phabricator instance now.

I tried to fix this with a fresh centos 7 and noticed that APCu is working now without any adjustments. So I think stick with it until Phabricator supports PHP7. I hope upgrading php5.4 to php7 on centos7 isn’t to difficult…

Phabricator already supports PHP7 (minimum 7.1 as for some reason 7.0 was launched without the ability to make async calls)

If you want to install 7.1 and have internet access …
should do the trick!

Thanks! One final question: Do you use any opcache with php7.1 ?

I do indeed.


(disclaimer I typed these so apologies for spelling if necessary)

I do remember doing a fair amount of research for this one to get settings that made sense in my environment, but I’m struggling to find the content as to why I ended up like this. I have a feeling that I may have tuned it for the consumption and accelerated files numbers.

1 Like