Call us Toll-Free:
Email us


How to install APC on Linux / RedHat

Mike Peters, 06-14-2010
APC (Alternative PHP Cache) is an opcode cache for PHP that pre-compiles commonly used PHP scripts to machine-language, speeding up execution.

We previously used eAccelarator which is another opcode cache for PHP. We decided to switch from eAccelarator to APC due to stability issues and the fact that APC was chosen as the best opcode cache engine to be included with PHP6.

In this post, I'll cover the steps to install APC:

1. Type: 'pecl config-set preferred-state stable'
2. Type: 'pecl install apc'
3. When prompted type 'all' to change configuration
4. Type 'no' to change the option
5. Hit the enter key to run the installation script.
6. When complete, open /usr/local/lib/php.ini for editing
7. Comment out all eaccelerator lines if they exist
8. Add the following block:

Additional settings and explanations for each can be found at:

9. Save the file and exit the editor

10. Change the system setting for shared memory as follows:
a. edit /etc/sysctl.conf
b. add this line:


c. the run the following command:
sysctl -w kern.ipc.shmmax=134217728

11. Restart FastCGI manager with:
/usr/local/bin/php-fpm restart

Mike Peters, 06-14-2010

If you're installing APC on a machine that has WordPress with APC-Cache turned on, you have to tell APC to avoid caching the wp-cache config file.

Otherwise, WordPress will stop loading, showing a white screen or a PHP fatal error.

Here's how to get APC and WP-Cache playing nicely:

In php.ini in the [apc] section, add:


This tells APC to exclude wp-cache-config.php and wp-cache-config-sample.php

M.Ibrahim, 10-04-2011
I have a Dell servers and (APC Smart-UPS 3000XL)I want the public when the power turns off the power to work the (APC Smart-UPS 3000XL) to extinguish the server directly.
Please how to connect with the server and how the server deals with Mark (APC Smart-UPS 3000XL), estimated your cooperation in advance
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

Post your comments

Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.

About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions