Home > Article > Backend Development > PHP OPCode cache APC detailed introduction_PHP tutorial
Introduction to APC
The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.
APC official website: http://www.php.net/manual/en/book.apc.php
Download address of the latest version under WIN: http:// downloads.php.net/pierre/
Download link: http://downloads.php.net/pierre/php_apc-3.1.4-5.3-VC6-x86.zip Use the corresponding version according to your own PHP compiled version The corresponding DLL
APC configuration
APC configuration mainly explains the configuration under WIN. There are many online articles about configuration under Linux
1. Download php_apc.dll to the ext directory of PHP
2. Modify php.ini and add extension=php_apc.dll
Add configuration items at the end of php.ini
; APC Setting
[APC]
;When turning on stat, an error will be reported
;apc.stat=0
apc.enabled=”1″
apc.shm_segments=”1″
;Here Question, the default memory configuration has been modified here and an error occurred under WIN7. I wonder if anyone has encountered it?
;apc.shm_size=”128″
; apc.ttl=7200
; apc.user_ttl=7200
; Corrected parameters
apc.ttl=”300″
apc.user_ttl=”300″
apc.num_files_hint=”1024″
apc.mmap_file_mask=”E:/Wamp/tmp/ apc.XXXXXX”
apc.enable_cli=”1″
3. Restart the apache server and check if there are apc configuration items in phpinfo. If so, the configuration is successful.
APC control panel, the control file comes from APC-3.1.4.tgz
Before caching is used
After using cache
FAQ:
1. OPCode cache clearing problem under fcgi?