Installing APC on PHP 5.3

In a previous post I had some instructions for building PHP 5.3 on 64-bit CentOS 5. Turns out the caching extension listed there, eAccelerator, didn’t show a marked performance benefit in our benchmark testing. So instead I decided to play with APC, one of the competitors. Getting this installed was a bit tricky though (e.g., compiling statically errors out), so follow these steps:

# First build PHP as usual, since we'll be installing this as a shared extension
# Then try to get rid of any leftover header files
yum remove php-devel
 
# Symlink your "real" php include directory
mv  /usr/local/include/php /usr/local/include/php-previous-version
cd /usr/local/include
ln –s /path/to/new/php/source/dir php
 
# only the beta version of APC works on PHP 5.3; see http://pecl.php.net/bugs/bug.php?id=16078
pecl install apc-beta
mv /usr/local/lib/php/extensions/no-debug-non-zts-20060613/apc.so /usr/lib/php/modules
 
# copy the APC dashboard script to your webroot
cp /usr/local/lib/php/apc.php /path/to/your/webroot
 
# Add the extension in a new file /etc/php.d/apc.ini
; Enable apc extension module
extension=apc.so
apc.enable = 1

Bounce apache and then go to yourdomain.com/apc.php to see the status.

Enjoy.

2 comments

  1. Hell? ?ll, guy?? ? kn?w, m? m?ssage m?? b? t?? ??ecif?c,
    ?ut my si?t?r f?und nic? man h?re and th?? marr??d, so h?w ?bout m??! 🙂
    ? am 25 year? ?ld, ?hr??tina, fr?m R?m?nia, ? know English ?nd German languages al?o
    ?nd… ? h?v? ?pe?ific d??eas?, n?m?d nymph?man??. ?h? kn?w wh?t i? thi?, ??n under?t?nd m? (bett?r to ?a? it ?mm?d??t?ly)
    ?h yes, ? co?k ver? t?st?? ?nd ? lov? not ?nly c?ok ;))
    ?m real g?rl, n?t ?ro?t?tut?, ?nd l?ok?ng for s?r??us and h?t relat??nship…
    ?n?w??, y?u ?an find m? ?rof?l? h?re: http://turcacipapmo.ga/idl-59052/

Leave a comment

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