background preloader

APC - Alternative PHP Cache

Facebook Twitter

Using APC with PHP. Cache Cow If you’ve been around PHP for a while, you’ve probably heard about APC, the Alternative PHP Cache.

Using APC with PHP

APC is an opcode cache that can significantly speed up your PHP applications, by caching both PHP code and user variables. Adding APC to an application usually results in improved application response times, reduced server load and happier users. In this article, I’ll introduce you to APC, guiding you through the process of installing and configuring it and showing you a few examples of how it works. I’ll also walk you through the APC administrator interface, which lets you view APC performance in real time, and show you how you can use it with the Zend Framework.

Getting Started First up, a quick description of what APC is and how it works. As you probably already know, PHP is an interpreted language (unlike, say, Java or C++). Does it work? Shell> pecl install apc-3.1.4 shell> cd apc-3.1.4 shell# phpize shell# . Digging Deeper A Galaxy Far, Far Away Next, try refreshing the page. <? APC. Disclaimer: i do not guarantee it will work for you so you better use it at your own risk.

APC

It works for me. * I am using # symbol for all shell commands I am posting a quick step-by-step guide to install APC on servers (dedicated or VPS) with cpanel/whm working. First login as a root to your server/vps and make a directory to work with this plugin, #mkdir /home/APC-php #cd /home/APC-php now here we will first download the APC with following command #wget you can check for the latest version now you can use gzip and tar separately or tar -xzvf to unzip this file #tar -xzvf APC-3.0.14.tgz now you will have a APC-3.0.14 folder. #cd APC-3.0.14 now you have to make php configuration files by following command #phpize after this use following three commands # .

*if you do not know the php path then execute ( which php ) command it will display the path. on a typical cpanel vps it could be /usr/bin/php-config or /usr/local/bin/php-config but you better check it before executing the above command) #make. APC - Alternative PHP Cache. The Alternative PHP Cache (APC) is a free and open opcode cache for PHP.

APC - Alternative PHP Cache

Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code. Besides a opcode cache it provides a user cache for storing application data. This module uses the APC user cache as a cache backend for Drupal. Use APC for caches that do not change often and will not grow too big to avoid fragmentation. The default setting of APC will allow you to store 32 MiB for the opcode cache and the user cache combined. Drupal 6 The APC backend can be run for drupal 6 using cache backport. Maintainers Drupal 7: R.Muilwijk (sponsored by Trinoco)Drupal 5&6: Slantview Installation instructions.