HOWTO: Install PECL APC Cache with XAMPP on Linux
XAMPP is a packaged, self-contained distribution of Apache, Mysql, PHP and tons of hard-to-install PHP extensions. Not only does it make sysadmin's life easier, by solving 99.9% of LAMP problems out-of-the-box, but it also allows PHP-vendors to create packaged distributions of complex systems. Even with a long list of packaged extensions that XAMPP ships with, it still does not contain everything. One crucial missing PECL plug-in is the Alternative PHP Cache (APC). APC is a rock-solid op-cache for PHP script pre-compilation and caching. It is used in massive deployments like Yahoo!. XAMPP comes packaged with eAccelerator, another popular PHP op-cache. Both eAccelerator and APC used to suffer from the infamous Segmentation Fault bug that freezes Apache randomly. Due to this bug, one could only use the benefits of the op-caches in redundant deployments. Fortunately, the bug was fixed in the latest release of APC, making APC even more appealing than before. Following is a 5-minute run-through of APC installation on XAMPP/Linux:
- Make sure you uninstall or disable all and any PHP installations you may have had before. Same goes for legacy PECL and PEAR installations.
- Download and install the latest XAMPP distribution.
- (Optionally) Add /opt/lampp/bin to your PATH
- Download and install XAMPP Development Package.
Caution: this step will overwrite any configuration changes you might had made to XAMPP, previously. - Download APC version 3.0.16 or later.
- $ sudo su - (or change to root in any other way you can)
- # cd APC-3.0.16
- # /opt/lampp/bin/phpize
- # ./configure
- # make (ignore the request to run "make test")
- # make install
- Edit /opt/lampp/etc/php.ini and add the following lines:
extension="apc.so" apc.enabled="1" apc.shm_size="30" - Restart Apache by issuing: /opt/lampp/lampp restart
- Make sure APC got installed by issuing: "/opt/lampp/bin/php -m" and looking at the list of installed PHP extensions.




Comments
thanks
very helpful article. when I try in debian, the configure will not find php-config so I must run this way: ./configure --with-php-config=/opt/lampp/bin/php-config
Hi, could you give more
Hi, could you give more details about steps 7 and 8? I dont understand...
Thanks!
Unable to load dynamic library '/opt/lampp/lib/php/extensions...
hi, after run /opt/lampp/lampp restart i got following info: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/apc.so'
Post new comment