APC not Caching Properly



After following the guides/scripts on the Wiki and a bit of playing, I managed to install a custom build of PHP 5.2.0 and APC 3.0.14

I’ve replicated this install on a local server as well.

Locally, the caching works like a charm! When I upload my script, however, it seems to go bonkers on me. APC is listed in phpinfo(), and calling the functions does not result in an error, but the variables set will not hold… here’s an example



apc_store(‘test’, ‘Hello World’, 500);

$bar = ‘BAR’;
apc_store(‘foo’, $bar);

echo 'Output apc_fetch vars

echo ‘
echo apc_fetch(‘test’);
echo ‘

echo 'Output cache info



echo ‘



[/code][b]fail_frame.php[/b] [code]<?php

echo apc_fetch(‘test’);


[/code]in action http://www.doodoostyle.com/apctest/fail/fail.php


Any help would be greatly appreciated. I hope i didn’t miss anything super obvious… It’s just odd it works locally and not on DH’s servers.


Just a guess - are you running PHP in FCGI mode or not?
APC requires PHP to be running in FCGI mode in order to actually utilize it.

Otherwise I’m not quite sure at this moment.

Chips N Cheese - Custom PHP installs and the like!


Thank you for your quick reply. As far as I know it is running in FCGI… here’s a link to a temp phpinfo() if that helps at all


and the .htaccess file in root is as follows

AddHandler phpFive .php Action phpFive /cgi-bin/php.cgiI remeber reading a change in the .htaccess to use FCGI in PHP custom ini setup
but I don’t read anything like this in the PHP5 custom install

But i thought there might be a chance my htaccess is not telling my scripts to use FCGI. Sorry, I’m fairly new to anything beyond being a code monkey :smiley:


The guy here

seems to be having the same problem, but the language used beyond the first post is a little cryptic to a unix noob such as myself. From what I gather he’s running into problems a shared hostee shouldn’t, though.


I’m starting to get fed up with this silliness. I’m thinking of just reverting back to the dreamhost install with custom ini/pear/pecl. I’m going to keep trying little fixes as I find them. If I can’t get this fixed by tomorrow I’m going to see how well DH’s install handles this.

You were correct, FastCGI wasn’t running. After confirming this, I followed steps at

and got things up and running :smiley: Thank you.