. Overview:
Alternative Php Cache (APC) is a free and public php Optimized Code Cache. It is used to provide free, public, and robust architectures to cache and optimize php intermediate code.
Note:
1. In Windows, APC requires a temporary path and the Web server has the write permission. It checks the TMP, TEMP, and USERPROFILE environment variables in sequence. If they are not set, use the WINDOWS directory.
2. APC does not support distributed deployment.
II. installation:
Download the PECL dll package from pecl4win.net. php and put it in the PHP5/ext directory. In fact, the pecl package corresponding to php5.2.5 already contains this file.
III. Configuration
Open php. ini and add the Code:
Extension = php_apc.dll
[APC]
Apc. enabled = 1
Apc. shm_segments = 1
Apc. shm_size = 64
Apc. max_file_size = 10 M
Apc. stat = 1
IV. Script test:
Restart the Web server and test:
1). Set the entries to be cached.
Store. php
<? Php
$ Bar = 'bar ';
Apc_store ('foo', $ bar );
?>
2). Obtain the cached entries.
Fetch. php
<? Php
Var_dump (apc_fetch ('foo '));
?>
Run store. php and run fetch. php to check the effect.