This article mainly introduces the installation and configuration notes of the PHP accelerator APC in Linux. This article also describes how to install apc in Windows, need a Friend can refer to the current I use a APC-3.1.9 stable, you can go to the http://pecl.php.net/package/APC to download the latest version.
1. Installation
The code is as follows:
Wget http://pecl.php.net/get/APC-3.1.9.tgz
Tar xzvf APC-3.1.9.tgz
Cd APC-3.1.9
/Usr/local/php/bin/phpize
. /Configure -- enable-apc-mmap -- with-php-config =/usr/local/php/bin/php-config -- prefix =/usr/local/apc
Make & make install
Note: Check the corresponding directory after installing and compiling:
The code is as follows:
Ll/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
-Rwxr-xr-x 1 root 659164 Apr 8 apc. so
Installed successfully!
2. configure/usr/local/php/etc/php. ini.
The code is as follows:
Vi/usr/local/php/etc/php. ini
Shift + g to the last row and add at the end
The code is as follows:
[Apc]
Extension = "/usr/local/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 = 64
Apc. ttl = 7200
Apc. user_ttl = 7200
Apc. num_files_hint = 0
Apc. write_lock = On
Then copy the APC. php file under the apc directory to the accessible directory.
The code is as follows:
Cp/root/APC-3.1.9/apc. php/home/wwwroot/
3. restart LNMPA
The code is as follows:
/Root/lnmpa restart
4. Appendix: install apc in Windows
: Http://kromann.info/php5_2-Release_TS/php_apc.dll
The code is as follows:
Extension = php_apc.dll