Centos5.8 x86 install eAccelerator
先確認是否安裝了 php-devel,autoconf,automake,m4,libtool
yum list php-devel autoconf automake m4 libtool
安裝 php-devel
yum -y install php-devel
※其餘若未安裝請用 yum search 需要安裝哪些套件!!!
下載 eacceler-0.9.6.1
download eaccelerator-0.9.6.1.tar.bz2
解壓
tar -jxvf eaccelearator-0.9.6.1.tar.bz2
cd eaccelearator-0.9.6.1
執行phpize
phpize
./configure --enable-eaccelerator=shared \
--with-php-config=/usr/bin/php-config
編譯安裝
make
※make 的過程會出現錯誤訊息
zend_property_info’ has no member named ‘ce’
make: *** [ea_store.lo] Error 1
解決方式
vim ea_store.c
用 // 註解683行 return (child_info->ce !=from)
再一次 執行 make
make install
echo "/usr/lib/php/modules/" \
>/etc/ld.so.conf.d/php.conf
執行 ldconfig
ldconfig
修改 php.ini
vim /etc/php.ini
在最底下加入
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/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"
建立phpinfo.php
vim /var/www/html/phpinfo.php
<?php
phpinfo();
?>
建立 eaccelerator的暫存資料
mkdir /tmp/eaccelerator
chmod 777 /tmp/eaccelerator
重啟 apache
service httpd restart
測試
http://your.IP(domain)/phpinfo.php
or
php -v
出現with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
鳥哥私房菜
eAccelerator Configuration With PHP5
centos安装Zend Optimizer与eAccelerator