Installing PHP APC On RHEL/CentOS
- Yum up some packages:
yum install php-pear php-devel httpd-devel
- Install APC using pear (the pear installer is smarter than the pecl installer):
When the installer asks about APXS, say ‘no’.Âpear install pecl/apc
- Tell PHP to load APC:
echo extension=apc.so > /etc/php.d/apc.ini
- Restart Apache:
/sbin/service httpd graceful
9 Comments
Comments RSS TrackBack Identifier URI
Leave a comment
Thanks. Very simple, very clear, very complete directions. Are you sure you are a linux guy? They are going to revoke your group membership privileges if you don’t make these directions either partially incomplete or somewhat arcane.
@Mark:
Thanks, but don’t worry for me. These directions will become incomplete and misleading as soon as the underlying OS changes.
Many thanks. I agree with Mark. After seeing so many ridiculously complicated explanations of the above simple process I can only say again – thank you for you help and effort.
[...] Casey actually has some instructions that provide a more elegant method of installing APC on CentOS or [...]
Hi Casey,
Can you explain why you choose “no” for APXS?
Thanks,
-mike
Thanks for this!
Very clear.
Good job.
@Mike: Because there had to be at least one unexplained, obscure thing in a Linux related post?
Casey, I’d love to know the answer to Mike’s question as well. Did testing having answered ‘yes’ reveal subtle weirdness? Did things blow up spectacularly? Or does that let you avoid pulling in httpd-devel and all the compiler-related dependencies that that brings in?
Cheers (and add my thanks to the list!),
Justin
@Justin:
My first few tries were with APXS, but they failed (can’t remember errors). It didn’t blow up so bad that I couldn’t try again, it just didn’t work.