The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.
Questions tagged [apc]
963 questions
8
votes
2 answers
What's the maximum key length for PHP APC?
You would think this would be super-easy to find, but I can't seem to.

Christophe
- 2,052
- 1
- 19
- 24
8
votes
7 answers
APC and PHP - Broken Sites Due to Cache Mixing
I hope someone can give me a hand figuring this out. I have been running APC recently on some of my servers that host only one application and it's been working great. Unfortunately I went to run it tonight on my workhorse web server and as soon…

Shane
- 16,779
- 5
- 27
- 46
8
votes
2 answers
PHP APC To cache or not to cache?
I don't really have any experience with caching at all, so this may seem like a stupid question, but how do you know when to cache your data? I wasn't even able to find one site that talked about this, but it may just be my searching skills or maybe…

Joker
- 1,133
- 7
- 18
- 22
8
votes
5 answers
Choosing a PHP caching technique: output caching into files vs. opcode caching
I've heard of two caching techniques for the PHP code:
When a PHP script generates output it stores it into local files. When the script is called again it check whether the file with previous output exists and if true returns the content of this…

PHPguy
- 197
- 2
- 3
- 8
8
votes
4 answers
How to clear Doctrine APC cache for production?
I have this issue when I add a column to one of my entities and release it for production I have to restart Apache in order to clear Doctrine metadata APC/APCU cache.
I have tried all commands below but none worked for me:
php -r…

pmoubed
- 3,842
- 10
- 37
- 60
8
votes
1 answer
PHP : apc_store doesn't work as intended
I have started to try APC to store some specific data on each webserver as an complement to memcached.
However, the following code piece is giving me headaches:
echo apc_store('key', 'value');
echo apc_store('key', 'newvalue');
echo…

Industrial
- 41,400
- 69
- 194
- 289
8
votes
1 answer
PHP APC Cache, does it work out of the box?
So this is whats bothering me. I just installed APC cache and Im testing it.
When using APC Admin interface, in apc.php file, I can see all the info about APC etc.
When I go to System Cache Entries I can see that every script i invoke gets written…

otporan
- 1,345
- 2
- 12
- 29
8
votes
6 answers
Referencing the current server in Capistrano task
How would I reference the current server in a Capistrano task? I want to curl a local file to clear the APC cache but the server does not listen on localhost so I need the server's IP address.
For instance,
role :web, "1.1.1.1", "2.2.2.2",…

Brad Dwyer
- 6,305
- 8
- 48
- 68
7
votes
4 answers
Error installing apc for php on linux/centos
I followed this tutorial http://stevejenkins.com/blog/2011/08/how-to-install-apc-alternative-php-cache-on-centos-5-6/ to install apc on my centos vps hosting but I get some error messages on the last step. Here is the complete log from the…

King Julien
- 10,981
- 24
- 94
- 132
7
votes
1 answer
Difference between apc_add and apc_store?
I don't see any in the PHP docs:
http://www.php.net/manual/en/function.apc-store.php
http://www.php.net/manual/en/function.apc-add.php
Am I missing something here? When should I use each one?
And why are there two usage definitions, one returs true…

Alex
- 66,732
- 177
- 439
- 641
7
votes
1 answer
Getting APC to play nice with spl_autoload_register
I am using the Zend Autoloader to load Zend classes for integrating Zend_AMF with my application. Everything was working perfectly until I installed APC 3.1.9 and enabled it.
I am getting this error:
Fatal error: Access to undeclared static…

F21
- 32,163
- 26
- 99
- 170
7
votes
5 answers
php installation error
I have installed 'WampServer2.1e-x32' stack with addon version of php 5.2.11 . I downloaded apc3.0.19.dll and placed under the directory and required information in php.ini. To make it work.
Restarted wamp server and navigated to phpmyadmin and here…

user269867
- 3,266
- 9
- 45
- 65
7
votes
3 answers
apc_store isn't working between requests
$bar = 'BAR';
apc_store('foo', $bar);
var_dump(apc_fetch('foo'));
Within one request this work.
Now If i try to do a var_dump(apc_fetch('foo')); on another request it prints:
bool(false)
Any help?
I am on gentoo with PHP 5.2, APC-3.1.9
Here what…

dynamic
- 46,985
- 55
- 154
- 231
7
votes
2 answers
PHP "apc_store" and "apc_fetch" are not working as expected
I was trying to use APC but it doesn't seem to work as I expected.
file1:
$bar = 'BAR';
apc_store('foo', $bar, 3600);
var_dump(apc_fetch('foo')); // It works here. Displays BAR
file2:
var_dump(apc_fetch('foo'));
When I execute file2…

Andry R.
- 199
- 1
- 2
- 5
7
votes
6 answers
PHP5.6 and APC installation
How to install APC under PHP 5.6?
APC is installed
apt-get install php-pear php5-dev make libpcre3-dev
pecl install apc
# locate apc.so
/usr/lib/php5/20100525/apc.so
APC is added to php.ini
extension=apc.so
But APC is not mentioned in output from…

clarkk
- 27,151
- 72
- 200
- 340