1.APC Introduction
The alternative PHP cache (APC) Chinese full name is an "optional PHP buffer", an open source cache tool that works with PHP, and can be used to cache and optimize PHP code on a Web server to improve server performance.
2.APC Advantages
Both APC and eaccelerator are good php acceleration caches, but why is it recommended to use APC here?
(1) Stability
Based on our testing of several large sites, APC performance is slightly less than eaccelerator in low-load situations, but APC is more stable than eaccelerator in the case of long-running large traffic. If the site appeared in PHP suddenly suspended animation, no reason to appear 502 error, we recommend the use of APC.
(2) Technical support
APC has grown rapidly since FACEBOOK joined the update to APC and has grown considerably, and the new version of Eaccelerator has been poorly stabilized and features and code have been removed quite a bit.
(3) Compatibility
Good support for PHP5.3 and 5.4 versions by APC
3.APC installation (see Accessories for installation package)
[Email protected] opt]# tar zxf apc-3.1.13.tgz
[Email protected] opt]# CD APC-3.1.13
[Email protected] apc-3.1.13]#/usr/local/php/bin/phpize
[Email protected] apc-3.1.13]#/configure--with-php-config=/usr/local/php/bin/php-config--ENABLE-APC-- Enable-mmap--enable-apc-spinlocks--disable-apc-pthreadmutex
[[email protected] apc-3.1.13]# make && make install
[Email protected] apc-3.1.13]# Vi/usr/local/webapps/php/etc/php.ini #加入以下参数
Extension=apc.so
apc.enabled = 1
Apc.shm_size = 64M
Apc.stat = 1
Where Apc.shm_size set is the size of the memory, generally with 64M, memory can be changed to 32M.
Apc.stat is set to 0 o'clock, performance is improved. But every time the PHP file is modified, you have to restart PHP to take effect. If you usually need to change PHP frequently
File, it is recommended to set this parameter to 1.
4. Restart the PHP test
650) this.width=650; "title=" 0.jpg "style=" Float:none; "alt=" wkiol1s1_4djpxaeaaffghrvfva428.jpg "src=" http:/ S3.51cto.com/wyfs02/m02/58/9d/wkiol1s1_4djpxaeaaffghrvfva428.jpg "/>
650) this.width=650; "title=" 3.jpg "style=" Float:none; "alt=" wkiom1s1_rbboznfaagj3wjrime990.jpg "src=" http:/ S3.51cto.com/wyfs02/m02/58/a0/wkiom1s1_rbboznfaagj3wjrime990.jpg "/>
This article is from the "Linux art (q Group: 1991706)" blog, please be sure to keep this source http://304076020.blog.51cto.com/7503470/1603882
Linux php5.4 installation accelerates expansion of APC configuration