How to update APC on the Zend community server (required for Symfony2)?

I am starting the last Zend community server and want to find out Symfony2, but config.php gives me an error that my APC (alternative php cache) is out of date and I have to update it.

I am running OS X Lion and have 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 I have no idea how to compile it or where to put it.

+8
php apc symfony zend-server
source share
6 answers

I tested my previously posted (and now deleted) configuration several times and had to remove the manual . The make test command returned a bunch of errors. The reason is that Zend has its own bytecode in some extensions (for example, APC!).

I reset Zend Server CE and still switch to MAMP. Give my working guide on how to properly configure Symfony 2 on MAMP: Click here .

+3
source share

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

So, you just need to comment on the APC check in the Symfony2 configuration. Caching will still work.

To disable APC in Symfony2, do the following:

  • 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+).' ); } 

from

 /* 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/

+4
source share
+3
source share

I am also a Mac user, and I ran into the same issue with Symfony and Zend Server. In the end, I disabled the apc extension from the Zend Server control panel. Thus, the warning that appeared in the symfony configuration turned into a notification telling me about installing apc or some other cache manager. After that, I turned on apc again and everything worked fine. I now don’t fix it very well, but you probably faced this problem when trying to develop locally, and you probably won’t have this problem when loading the site on a real hosting.

Hope this helps!

+2
source share

The Zend server does not support APC, as far as I know.

They provide wrapper functions that map APC functions to Zend Data Cache objects.

+2
source share

WINDOWS ONLY

This worked for me:

Enabling Alternate PHP Cache Extension (APC) on Zend CE Server

 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 phpinfo () on the Zend toolbar and you will see something like the following: apc and various directives are output in the output configuration part. Any of the APC file download indicator plugins (e.g. http://www.ibm.com/developerworks/library/os-php-v525/index.html ) should now work.

+1
source share

All Articles