php apc

【apc】
The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.

【安装】-linux平台
1.pecl安装
pecl在php bin目录下面(PHP5.4.24)
--pecl install apc

2.源码安装
wget http://pecl.php.net/get/APC-3.0.19.tgz
tar xzvf APC-3.0.19.tgz
/usr/local/webserver/php/bin/phpize
./configure –enable-apc –enable-apc-mmap –with-php-config=/usr/local/webserver/php/bin/php-config –prefix=/usr/local/apc
make && make install


【配置】
配置php.ini
[apc]
extension=apc.so ;(要结合extension_dir,否则要全路径)
apc.enabled = 1       ;(启用apc,0为禁用)
apc.cache_by_default = on  ;(File cache支持编译后的文件)
apc.shm_segments = 1   ;(共享内存块数)
apc.shm_size = 64       ;(共享内存大小)
apc.ttl =0 ;(Time To Live nothing will be removed until the entire cache becomes full)
apc.gc_ttl = 7200 ;(The number of seconds that a cache entry may remain on the garbage-collection list)
apc.num_files_hint = 0 ;(number of distinct user cache variables to store. Set to zero or omit if not sure)



【测试】
拷贝apc.php到web目录下面(apc.php在php家目录的lib下面)






【参考】
http://blog.lixiphp.com/linux-php-apc-install-configuration/#axzz36OfJeWX2
http://www.jb51.net/article/38377.htm
http://purpen.iteye.com/blog/774790/
http://techportal.inviqa.com/2010/10/07/understanding-apc/

猜你喜欢

转载自runpanda.iteye.com/blog/2088044
今日推荐