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