Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
410 views
in Technique[技术] by (71.8m points)

php - How do I upgrade APC on Zend Community Server (needed for Symfony2)?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...