fix to solve fatal error: apc_exist() does not exist #238

wants to merge 1 commit into


None yet

7 participants

uran1980 commented Jan 4, 2013

Hi, folks. I'm running Zend Server CE 5.6.0 SP4 with PHP Version 5.3.14 and APC builtin:

Now when I run in my project based on Symfony 2.1.6 the next comand:

console doctrine:fixtures:load --verbose

I am stack with fatal error:

Fatal error: Call to undefined function Doctrine\Common\Cache\apc_exists()


Possible solution are in my pull request.

As I descovered I am not alone with this problem:



thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

Ocramius commented Jan 4, 2013

@uran1980 what would the affected versions of APC be?

stloyd commented Jan 4, 2013

@Ocramius All below 3.1.4.

Ocramius commented Jan 4, 2013

@stloyd was confused by reading 3.1.14 :) Thx


I'm not a 100% I'd take this approach.
Cache should be extremely simple and including this small IF may have a huge impact on other projects that rely on our implementation of Cache.
I'm more towards starting to consider different drivers for different Cache versions, like we do in ORM for SQL Server.

What do you guys think?

Ocramius commented Jan 4, 2013

@guilhermeblanco I'd suggest @uran1980 to simply use a different cache adapter. Older APC versions tend to be horribly broken anyway.

uran1980 commented Jan 4, 2013

I use latest availeble version of ZendServer 5.6.0 (PHP 5.3) SP4 with builtin APC. In phpinfo() there is no version infomation about installed APC available, all info that I can see is:

I download from latest php_apc.dll extension and copy it to C:\server\ZendServer\lib\phpext and restart server. Now, as far as I know I have APC version 3.1.10 but how to prove it, how to get APC version? I am in frustration :(

Now for me single working solution is to change sourse code in ApcCache.php file.

Ocramius commented Jan 4, 2013

@uran1980 the test suite would prove it :)

beberlei commented Jan 6, 2013

I agree with guilherme that we should rather have a LegacyApcCache here that overwrites the original ApcCache#exists

@beberlei beberlei closed this Jan 10, 2013
jmikola commented Jan 11, 2013

@uran1980: You should be able to run phpversion('apc') to get APC's version.


Yes, but unfortunately for me:

phpversion()            returns: string(6) "5.3.14"
phpversion('apc')       returns: bool(false)
get_loaded_extensions() returns:
array(70) {
[59] => string(3) "apc"


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment