CentOS installation apc
APC mainly plays two roles. One is to save the php compilation cache in the shared memory. After using APC, it eliminates the need to compile the PHP source code into the PHP Opcode each time, improving performance. As long as the PHP source code is not modified next time, it does not need to be re-compiled. On the other hand, the role is similar to the Memcached function. APC saves data to the shared memory, while Memcached also saves the data in the memory. However, Memcached supports distributed, while APC does not support distributed.
1. Download an object
Find the latest stable apcversion from http://pecl.php.net/package/apc
wgethttp:
//pecl
.php.net
/get/APC-3
.1.9.tgz
tar
zxvfAPC-3.1.9.tgz
cd
APC-3.1.9
2. Compile and install
/usr/local/php/bin/phpize
.
/configure
--
enable
-apc--
enable
-apc-mmap--with-php-config=
/usr/local/cine/php/bin/php-config
make
make
install
3. Modify 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=1
apc.cache_by_default=on
apc.shm_segments=1
apc.shm_size=32M
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=0
apc.write_lock=on
4. Check whether the installation is successful.
php-m|
grep
apc
If apc is displayed, the installation is successful.