Cài đặt PHP APC trên RHEL/CentOS

1. Yum up some packages:
yum install php-pear php-devel httpd-devel

2. 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

3. Tell PHP to load APC:
extension=apc.so (/etc/php.ini)

4. Restart Apache:
/sbin/service httpd graceful

In the future, if new versions of APC are released, you can easily upgrade them using
sudo pecl upgrade apc

How to reinstall APC:

# pecl uninstall apc
# mv /etc/php.d/apc.ini /tmp/apc.ini
# yum update php
# pecl -d memory_limit=16M install apc
# mv /tmp/apc.ini /etc/php.d/apc.ini


# # install APC package
# yum install php-pecl-apc
# # install gd package to have graphs in APC dashboard (optional)
# yum install php-gd


Upgrade PHP 1.6 lên PHP 5.2 thì APC sẽ không chạy, xem thêm cách cài lại và xử lý: http://trieuphu.vatly.net/2011/12/21/upgrade-php-1-6-len-php-5-2-va-apc/

Leave a Reply