Home > PHP > Setup APC

Install APC

yum install php-pear php-devel httpd-devel pcre-devel gcc make
pecl install apc

Enable APC

vim /etc/php.d/apc.ini
extension=apc.so
apc.enabled=1
apc.max_file_size=5M
apc.num_files_hint=10000
apc.user_entries_hint=10000
apc.shm_size=256M
apc.stat=0
apc.ttl=86400

Setup APC Admin Page

cp /usr/share/pear/apc.php /var/www/vhosts/myhelper/htdocs/apc.php
vim /var/www/vhosts/myhelper/htdocs/apc.php
defaults('ADMIN_USERNAME','myhelper');
defaults('ADMIN_PASSWORD','123456');

Restart Apache

/etc/init.d/httpd graceful

Clear APC Cache

<?php apc_clear_cache(); ?>

Reference:
http://www.agileapproach.com/blog-entry/howto-install-pecl-apc-cache-centos-without-xampp/
http://www.tipsandtutorials.net/centos-6-install-apc.html



Flag Counter