Speed Up your PHP site with APC

PHP APC is cache module provided by pecl and can be install via pecl. I assume you already had installed pecl.

sudo pecl install apc

That will install APC. After this let’s create apc.ini in /etc/php.d/.

sudo vim /etc/php.d/apc.ini

And paste this in it: [vim: to start writing hit Insert key, when finished writing hit Esc key. Ctrl+z twice to save and exit OR :wq]


Open /usr/share/pear/pearcmd.php for writing:

sudo vim /usr/share/pear/pearcmd.php

Paste/type this in it for memory management at the beginning:

@ini_set(‘memory_limit’, ’16M’);

Normally i keep it at 32MB, but choice is yours.

Now restart the web server and check it via phpinfo().

To upgrade it in future:

sudo pecl upgrade apc

M M Arif

Founder of www.therandombits.com and anl4u.com. Husband. Father. Senior Software Engineer. Linux enthusiast, using multiple Linux operating systems for personal use and work. A self taught programmer who love to code and share. Fan of open source and community projects.

You may also Like

Leave a reply

Your email address will not be published. Required fields are marked *