PHP OPCode cache APC details

  • 2020-03-31 21:16:00
  • OfStack

The introduction of the APC

The Alternative PHP Cache (APC) is a free and open opcode Cache for PHP. Its goal is to dojo.provide a free, open, and robust framework for caching and optimizing PHP intermediate code.

APC's official website: (link: http://www.php.net/manual/en/book.apc.php)

WIN under the latest version of the download address: (link: http://downloads.php.net/pierre/)

Download link: (link: http://downloads.php.net/pierre/php_apc-3.1.4-5.3-VC6-x86.zip) according to their own compile PHP version using the corresponding DLL

APC configuration

APC configuration mainly explains the configuration under WIN, and there are many online articles on configuration under Linux

1. Download php_apc.dll to the ext directory of PHP

2. Modify php.ini to add extension=php_apc.dll

Add the configuration item at the end of php.ini

; The APC Setting
[the APC]
; Turning on stat reports an error
; Apc. Stat = 0
Apc. Enabled = "1"
Apc. Shm_segments = "1"
; Here's the problem, here modified the default memory configuration WIN7 error, I do not know you encounter no?
; Apc. Eaccelerator.shm_size = "128"
; Apc. TTL = 7200
; Apc. User_ttl = 7200
; Fixed � �
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 to see if there is a configuration project for apc in phpinfo.

< img Alt = "" border = 0 SRC =" http://files.jb51.net/upload/201010/20101012085650675.png ">

APC control panel, control file from apc-3.1.4.tgz

< img Alt = "" border = 0 SRC =" http://files.jb51.net/upload/201010/20101012085650152.png ">

< img Alt = "" border = 0 SRC =" http://files.jb51.net/upload/201010/20101012085650742.png ">

Before using the cache

< img Alt = "" border = 0 SRC =" http://files.jb51.net/upload/201010/20101012085650873.png ">

After using the cache

< img Alt = "" border = 0 SRC =" http://files.jb51.net/upload/201010/20101012085650594.png ">

Frequently asked questions:

1. Cache clearance of OPCode under fcgi?


Related articles: