How do I upgrade APC on Zend Community Server (needed for Symfony2)?
Asked Answered
M

6

8

I am running latest Zend Community Server and want to learn Symfony2 but the config.php gives me an error that my APC (alternative php cache) is deprecated and I have to upgrade it.

I'm running OS X Lion and already found the zend folder in:

    /usr/local/zend/

I also downloaded the source package (3.1.9 stable) from http://pecl.php.net but have no idea how to compile it or where to put it.

Magnetron answered 9/10, 2011 at 14:9 Comment(1)
Why don't just install OLDER version of Symfony? :) Zend Server CE give an error saying 'upgrage you APC', just you can just downgrade the SymfonyDomineering
M
3

I tested my previously posted (and now deleted) configuration a few times and had to withdraw the guide. The make test command returned a bunch of errors. The reason among other things is that Zend has their own bytecode in some extensions (like APC!).

I dumped Zend Server CE and switched to MAMP after all. Give my working guide on how to correctly set up Symfony 2 on MAMP a shot: Click here.

Magnetron answered 10/10, 2011 at 0:3 Comment(0)
D
4

Ok, so I probably found best solution - Zend Server has build-in Zend Optimizer+, which is ~1.8 times faster that APC (320 req./s VS ~190 req./s or regular ultrabook).

So you just need to comment-out APC check in Symfony2 configuration - Caching will still work.

To disable APC in Symfony2, do this:

  1. Open the Symfony2 requirements file:

/Symfony/app/SymfonyRequirements.php

And REPLACE the following lines of code:

        if (version_compare($installedPhpVersion, '5.4.0', '>=')) {
            $this->addRequirement(
                version_compare(phpversion('apc'), '3.1.13', '>='),
                'APC version must be at least 3.1.13 when using PHP 5.4',
                'Upgrade your <strong>APC</strong> extension (3.1.13+).'
            );
        } else {
            $this->addRequirement(
                version_compare(phpversion('apc'), '3.0.17', '>='),
                'APC version must be at least 3.0.17',
                'Upgrade your <strong>APC</strong> extension (3.0.17+).'
            );
        }

with:

/* DISABLED FOR ZEND SERVER, USING ZEND OPTIMIZER+ INSTEAD
       if (version_compare($installedPhpVersion, '5.4.0', '>=')) {
            $this->addRequirement(
                version_compare(phpversion('apc'), '3.1.13', '>='),
                'APC version must be at least 3.1.13 when using PHP 5.4',
                'Upgrade your <strong>APC</strong> extension (3.1.13+).'
            );
        } else {
            $this->addRequirement(
                version_compare(phpversion('apc'), '3.0.17', '>='),
                'APC version must be at least 3.0.17',
                'Upgrade your <strong>APC</strong> extension (3.0.17+).'
            );
        }
*/

Source: http://phpcloud-symfony2.pen.io/

Domineering answered 14/7, 2013 at 2:19 Comment(1)
Best answer as this is by far the easiest and quickest solution. However, you should delete your other two answers. It's not generally recommended to answer more than once on a single question.Melany
M
3

I tested my previously posted (and now deleted) configuration a few times and had to withdraw the guide. The make test command returned a bunch of errors. The reason among other things is that Zend has their own bytecode in some extensions (like APC!).

I dumped Zend Server CE and switched to MAMP after all. Give my working guide on how to correctly set up Symfony 2 on MAMP a shot: Click here.

Magnetron answered 10/10, 2011 at 0:3 Comment(0)
T
3

I found a possible solution here

Hope that helps

Tunicate answered 28/11, 2012 at 6:35 Comment(1)
does this also support mac users?Magnetron
D
2

I'm a Mac user too, and I faced the same problem with Symfony and Zend Server. What I finally did was disable apc extension from my Zend Server control panel. Doing so, the warning that appeared into symfony configuration turned into a notice telling me to install apc or some other cache manager. After that, I enabled apc again and everything is working fine. I now it's not a nice fix, but probably you're facing this problem when trying to develop locally, and you probably won't have this problem when you upload a site to a real hosting.

I hope it helps!

Devote answered 9/10, 2011 at 22:11 Comment(0)
C
2

Zend Server does not support APC as far as I know.

They supply wrapper functions which map the APC functions to the Zend Data Cache objects.

Colan answered 25/4, 2012 at 7:37 Comment(0)
D
1

WINDOWS ONLY

This worked for me:

Enabling Alternative PHP Cache (APC) extension in Zend Server CE

Download non-thread safe VC9 APC DLL (I went for php_apc-5.3-nts-svn20100226-vc9-x86.zip) from http://downloads.php.net/pierre/
Unzip it and put the extension dll php_apc.dll into C:\Program Files\Zend\ZendServer\lib\phpext (assuming you left the Zend Server install location as its default)
Add the following to your php.ini (in C:\Program Files\Zend\ZendServer\etc):

;Enable APC
extension=php_apc.dll
;Enable upload progress bar
apc.rfc1867=on

Give Apache/PHP a restart

Now check out phpinfo() on the Zend dashboard and you should see something like the following, with apc and the various directives being output in the configuration part of the output. Any of the APC file upload progress bar plugins (e.g. http://www.ibm.com/developerworks/library/os-php-v525/index.html) should now work.

Domineering answered 12/7, 2013 at 20:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.