Install APC on Ubuntu 12.04

本文介绍如何在Debian/Ubuntu系统上安装和配置APC(Alternative PHP Cache),以提高PHP脚本的执行效率。通过缓存预编译的PHP字节码来减少重复编译的时间开销,并提供了调整内存限制的方法来应对高内存消耗的情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值