APC has two main functions,The first is to save the PHP compilation cache in shared memory, it is simple to understand that after the use of APC, the provincegoing to need each time to be PhpThe source code compiles to PHP Opcode time, improves the performance, as long as the next PHP source code does not have any repair , you do not need to recompile. On the other hand the role is similarMemcachedthe function,APC is saving data to shared memory, Memcached also stores data in memory, but Memcached supports distributed, and APC does not.
1 downloading files
from http://pecl.php.net/package/ APC Find the latest APC Stable version
Wgethttp://pecl.php.net/get/apc-3.1.9.tgztar ZXVF APC-3.1.9.TGZCD APC-3.1.9
2 compiling the installation
/usr/local/php/bin/phpize./configure--ENABLE-APC--enable-apc-mmap--with-php-config=/usr/local/cine/php/bin/ Php-configmakemake Install
3 modifying php.ini
Vim/etc/php.ini
Add the following content:
[apc]extension= "/usr/local/cine/php/lib/php/extensions/no-debug-non-zts-20090626/apc.so" apc.enabled = 1apc.cache _by_default = onapc.shm_segments = 1apc.shm_size = 32mapc.ttl = 7200apc.user_ttl = 7200apc.num_files_hint = 0apc.write_loc K = On
4 Detecting whether the installation was successful
php-m | grep APC
If there is a display APC instructions have been installed successfully
This article is from the "Under Siege" blog, make sure to keep this source http://308107405.blog.51cto.com/6396647/1621839
Installing APC in CentOS