I can see you have found the solution yourself.
Still, if you need to know then its easy:
First install pear if its not installed, on CentOS its,
yum install php-pear
Next you have to install php development tools
yum install php-devel
then httpd development tools
yum install httpd-devel
Now, install APC
pecl install apc
If there is no error or problem then run :
echo "extension = apc.so" > /etc/php.d/apc.ini
Assuming, you followed exactly I have said, restart your apache.. and check in your phpinfo() for apc details.