全部博文(89)
分类:
2009-01-20 11:05:20
######################
# #
# eaccelerator #
# #
######################
wget
######################
#
# 安装
#
######################
tar jxvf eaccelerator-0.9.5.3.tar.bz2
cd cd eaccelerator-0.9.5.3
export PHP_PREFIX="/usr/local/webserver/php"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared \
--with-php-config=$PHP_PREFIX/bin/php-config
make
make install
# 通过 $PHP_PREFIX/bin/php-config 的设置,eaccelerator.so模块位于"/usr/local/webserver/php/lib/php/extensions/no-debug-# non-zts-20060613/" 目录下
###########################
#
# 修改配置文件php.ini
#
###########################
vi /etc/sysctl.conf
kernel.shmmax = 134217728 # 128M == echo 134217728 > /proc/sys/kernel/shmmax 一个程序可以使用的最大内存
/sbin/sysctl -p
vim $PHP_PREFIX/conf/php.ini
zend_extension="/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaelerator.shm_size="128"
eaccelerator.cache_dir="/usr/local/webserver/eaccelerator_cache"
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"
mkdir -p /usr/local/webserver/eaccelerator_cache
chmod 0777 /usr/local/webserver/eaccelerator_cache
# 以上的配置是把 eaccelerator 做为 Zend 的扩展模块来编译的办法。如果您的PHP是用安装模式编译的,要把 zend_extension改为zend_extension_ts
# 如果您是把 eaccelerator 做为 PHP的一个扩展,要用下面的配置
# extension="eaccelerator.so"
# eaccelerator.shm_size="16"
# eaccelerator.cache_dir="/usr/local/webserver/eaccelerator_cache"
# eaccelerator.enable="1"
# eaccelerator.optimizer="1"
# eaccelerator.check_mtime="1"