Chinaunix首页 | 论坛 | 博客
  • 博客访问: 298488
  • 博文数量: 61
  • 博客积分: 1508
  • 博客等级: 上尉
  • 技术积分: 720
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-13 08:26
文章分类

全部博文(61)

文章存档

2010年(1)

2009年(1)

2007年(59)

我的朋友

分类: 系统运维

2007-09-18 15:52:13

引用官方:
   eAccelerator is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.

下面就以我的CentOS 5.0为例介绍一下:

Step1 准备工作

  • php4 or php5 php-devel
  • autoconf
  • automake
  • libtool
  • m4
Step2 安装
   下载
   tar xvjf eaccelerator-0.9.5.2.tar.bz2
   cd eaccelerator-0.9.5.2
   phpize
   ./configure && make && sudo make install

Step3 配置
   sudo vi /etc/php.d/accelerator.ini
   accelerator.ini内容如下:
 

extension="eaccelerator.so"

eaccelerator.shm_size="16" eaccelerator.cache_dir="/var/cache/eaccelerator" eaccelerator.enable="1"

eaccelerator.optimizer="1"

eaccelerator.check_mtime="1"

eaccelerator.debug="0"

eaccelerator.filter=""

eaccelerator.shm_max="0"

eaccelerator.shm_ttl="0"

eaccelerator.shm_prune_period="0"

eaccelerator.shm_only="0"

eaccelerator.compress="1"

eaccelerator.compress_level="9"

具体个参数意义请参照

Step4 收尾工作
  mkdir -p /var/cache/eaccelerator
  chmod 0777 /var/cache/eaccelerator

  sudo service httpd restart
现在 php -v 应该如下显示:
$ php -v
PHP 5.1.6 (cli) (built: Mar 14 2007 18:56:07)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with eAccelerator v0.9.5.2, Copyright (c) 2004-2006 eAccelerator, by eAccelerator

具体效果嘛,自己测试看看了。呵呵

阅读(1922) | 评论(0) | 转发(0) |
0

上一篇:爱匿于小事

下一篇:中秋节快乐!

给主人留下些什么吧!~~