APC (alternative page cache) is an addon to php to increase execution time of PHP scripts. To do so APC caches previously compiled bytecode of PHP code which can be reused in later page requests. The install on Debian/Ubuntu based Linux distributions (in my case Ubuntu 12.04) is quite simple.
sudo apt-get install php-apc
sudo service apache2 restart
After install you should download the apc.php from the pecl repository The following line will download apc.php from version 3.1.10:
Upload this file to your webserver root. By calling the script you get a statistical representation of your memory used for APC. If your running a website which consumes a lot of memory, APC will unluckily fragment your memory cache a lot. Also the value Cache full count will increase. In that case you should increase the memory limit until it fits your needs by adding the following line to the apc configuration file apc.ini which can be found in /etc/php5/conf.d :
apc.shm_size=64
Thats it!
本文介绍如何在Debian/Ubuntu系统上安装和配置APC(Alternative PHP Cache),以提高PHP脚本的执行效率。通过缓存预编译的PHP字节码来减少重复编译的时间开销,并提供了调整内存限制的方法来应对高内存消耗的情况。
569

被折叠的 条评论
为什么被折叠?



