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. For more information, see
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. For more information, see
Currently I am using the APC-3.1.9 stable, you can download the latest version by yourself.
1. Installation
The Code is as follows:
Wget
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 line, 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
:
The Code is as follows:
Extension = php_apc.dll