Questions tagged [apc]

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.

963 questions
7
votes
5 answers

What is the best way to do server-side output caching in PHP?

I have a pretty complicated index.php now, and I would like to only run it once every hour. What is the best way to achieve this? Some ideas I've had Put it in APC with apc_store($page, 60*60*) - I feel this isn't what APC is for and will probably…
Paul Tarjan
  • 48,968
  • 59
  • 172
  • 213
7
votes
2 answers

Can I use APC AND memcached on the same server?

I am using memcache for cacheing objects, but would like to add in addition an opcode accelerator like APC. Since they both involve cacheing, I am not sure if they will be "stepping on each others toes", i.e. I am not sure if memcache is already an…
Stick it to THE MAN
  • 5,621
  • 17
  • 77
  • 93
7
votes
5 answers

apc.filters by path?

How would I use the apc.filters parameter in APC opcode caching to not cache certain paths? For example, I want caching to be active for anything under the path: "/var/www/vhosts" and exclude paths like "/usr/share/psa-horde/" I tried…
typeoneerror
  • 55,990
  • 32
  • 132
  • 223
7
votes
4 answers

Opcode (APC/XCache), Zend, Doctrine, and Autoloaders

I am trying to use either APC or XCache as an opcode to cache my php pages. I am using it with Zend and Doctrine and it's having a problem with the autoloader. If I try with APC, I get the following: Fatal error: spl_autoload() [
Chris Williams
  • 11,647
  • 15
  • 60
  • 97
7
votes
1 answer

PHP: APC enabled, but still doesn't work?

On my new Xubuntubox I installed the lamp-server tools, php, php-apc, added the extension=apc.so line to the php.ini and rebootet the system. Apache and PHP seem to work well, but APC doesn't. So I checked what the apc.php file would say: No cache…
erikbstack
  • 12,878
  • 21
  • 81
  • 115
7
votes
2 answers

Deadlock with apc_exists & apc_add? (apc & PHP)

I wonder if anyone has found any weird behaviours with apc_exists(), behaviour that causes the entire WAMP server to hang when using it together with apc_add() or apc_store()? After a long session of "debugging" and minimizing the problem I ended up…
Daniel MesSer
  • 1,191
  • 1
  • 7
  • 13
6
votes
3 answers

PHP ob_start vs opcode APC, explain differences and real world usage?

Premise: I'm not trying to reinvent the wheel, I'm just trying to understand. Output caching can be implemented easily: //GetFromMyCache returns the page if it finds the file otherwise returns FALSE if( ($page = GetFromMyCache($page_id)) !== FALSE…
Marco Demaio
  • 33,578
  • 33
  • 128
  • 159
6
votes
4 answers

Key groups with APC cache

APC lets you store data inside keys, but you cannot group these keys. So if i want to have a group called "articles", and inside this group I would have keys that take the form of the article ID I can't do this easily. articles -> 5 -> cached…
Alex
  • 66,732
  • 177
  • 439
  • 641
6
votes
2 answers

Why all my files are not cached with apc op code?

I'm using APC (3.1.9) and Zend Framework, however, only a bunch of file are being cached (something like 10 / 400). Do you have any ideas? I'm using the factory options on a debian installation. EDIT: It looks like the only file which are opcached…
Trent
  • 5,785
  • 6
  • 32
  • 43
6
votes
1 answer

Load balancing and APC

I am interested in a scenario where webservers serving a PHP application is set up with a load balancer. There will be multiple webservers with APC behind the load balancer. All requests will have to go through the load balancer, which then sends it…
F21
  • 32,163
  • 26
  • 99
  • 170
6
votes
2 answers

APC - how to handle GC cache warnings?

On occasion, maybe once a day, our PHP web server using APC will raise an E_WARNING error that my error handler catches and logs. It looks similar to this: require_once() [function.require-once]: GC cache entry '/path/file.php' (dev=47775802…
Stu
  • 1,282
  • 12
  • 29
6
votes
4 answers

APC (Alternate PHP Cache) Throwing Lots of PHP Notices

I got APC 3.1.9 setup on my Linux box running PHP 5.3.6. Caching works fine but I have noticed in our error logs, that APC throws a lot of PHP notices, such as: [Wed Jun 29 01:08:56 2011] [error] [client ip] PHP Notice: require_once()…
m_j
  • 148
  • 1
  • 3
  • 13
6
votes
1 answer

PHP APC module. Any disadvantages?

I wanted to know if anyone thought if there where any disadvantages to using APC? Also, I'd be interested in reviewing these options below and getting your opinion on them. Thanks. ; Enable apc extension module extension = apc.so ; Options for the…
Bryan Ruiz
  • 2,555
  • 5
  • 29
  • 35
6
votes
2 answers

Unknown type name 'zend_string'

I am trying to compile APCu cache extension using make && make install. I get a compilation error regarding not being able to find zend_string or zend_long. Do you guys know what extension I would need for these? Thanks :)
Kal
  • 2,239
  • 6
  • 36
  • 74
6
votes
1 answer

Will APC appear in PHP7?

I read all over internet that APC will be included in PHP6. However the PHP6 project was cancelled and they skipped one major version to avoid confusion, which then again causes more confusion. This however is another discussion for another time. My…
Junior
  • 671
  • 3
  • 9
  • 24