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

Closed
wants to merge 1 commit into
from

Projects

None yet

7 participants

@uran1980
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:
2013-01-04-15-15-sshot-1

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()

2013-01-04-15-20-sshot-1

Possible solution are in my pull request.

As I descovered I am not alone with this problem: http://stackoverflow.com/questions/9125904/apc-exist-does-not-exist

@doctrinebot
Collaborator

Hello,

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:

http://doctrine-project.org/jira/browse/DCOM-156

@Ocramius
Member
Ocramius commented Jan 4, 2013

@uran1980 what would the affected versions of APC be?

@stloyd
stloyd commented Jan 4, 2013

@Ocramius All below 3.1.4.

@Ocramius
Member
Ocramius commented Jan 4, 2013

@stloyd was confused by reading 3.1.14 :) Thx

@guilhermeblanco
Member

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
Member
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
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:
2013-01-04-21-20-sshot-1

I download from http://downloads.php.net/pierre/ latest php_apc.dll extension php_apc-3.1.10-5.3-vc9-x86.zip 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
Member
Ocramius commented Jan 4, 2013

@uran1980 the test suite would prove it :)

@beberlei
Member
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
Member
jmikola commented Jan 11, 2013

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

@uran1980

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