Objective
The performance of the PHP language is not significant in terms of performance compared to other compiled languages, but performance gains after using the opcode cache are obvious. Common main EACCELERATOR,XCACHE,APC This article mainly introduces the use of APC.
Introduction of APC
APC, the full name is alternative PHP cache, the official translation is called "Optional PHP Caching". It provides us with a framework for caching and optimizing PHP's intermediate code. The APC cache is divided into two parts: the system cache and the user data cache.
System cache
It means that APC caches the compiled results of the PHP file's source code and then compares the time stamp with each call. If it does not expire, it is run with the cached intermediate code. The default cache is 3600s (one hour). However, this can still waste a lot of CPU time. Therefore, you can set the system cache to never expire (apc.ttl=0) in php.ini. However, if you do this, you will need to restart the Web server after changing the PHP code. This type of cache is currently used more often.
User Data caching
Caching is read and written by the user using the Apc_store and Apc_fetch functions when writing PHP code. If you have a small amount of data, you can try it. If the amount of data is large, it would be better to use a more specialized memory caching scheme similar to memcache this class.
APC Module installation
: HTTP://PECL.PHP.NET/PACKAGE/APC
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/59/12/wKiom1TGQLWR9lHRAAQq0JlS36A324.jpg "title=" Apc.png "alt=" Wkiom1tgqlwr9lhraaqq0jls36a324.jpg "/>
First step: Download Php_apc.dll in/PECL.PHP.NET/PACKAGE/APC to correspond with PHP version Php_apc.dll into your ext directory
Step two: Let PHP.ini support the APC expansion module. Then open php.ini join:
Extension=php_apc.dll[apc]apc.enabled=1apc.shm_segments=1apc.ttl=300apc.user_ttl=300apc.num_files_hint= 1024apc.mmap_file_mask= "E:/WAMP/TMP/APC. XXXXXX "Apc.enable_cli=1
Restart the PHP container.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/59/0F/wKioL1TGQmeD-9dxAALr2BtQv1k868.jpg "title=" Apc1.png "alt=" Wkiol1tgqmed-9dxaalr2btqv1k868.jpg "/>
APC Parameter settings:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/59/12/wKiom1TGQhiwncPtAATNq8FCkFI375.jpg "title=" Apc3.png "alt=" Wkiom1tgqhiwncptaatnq8fckfi375.jpg "/>
APC can be managed by downloading the apc.php file contained in the APC package.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/59/12/wKiom1TGQwnTX218AAMn6xlhzkc209.jpg "title=" Apc4.png "alt=" Wkiom1tgqwntx218aamn6xlhzkc209.jpg "/>
This article is from the "dream to think XI" blog, please be sure to keep this source http://qiangmzsx.blog.51cto.com/2052549/1608582
PHP opcode cache: Install APC under window