php-fpm安装启动的php5.3.10,怎么安装加速器eaccelerator,或者zendOptimizer,或者ZendGuardLoader

ain017 发布于 2012/03/13 13:44
阅读 4K+
收藏 1

小弟最近终于在centOS上(6.2)搭建起了环境。由于想用nginx,所以使用php-fpm。完了装加速器的时候纠结了,研究了一天的eaccelerator,发现怎么装也装不上,最后在oschina上看见:

eaccelerator不支持php-fpm的加速!!!

ZendOptimizer只支持到php5.2。

ZendGuardLoader照着英文说明做,也搞不上去

网上找了好多文章,试了没用,请大家帮个忙吧,php-fpm模式下安装php加速器,对了,还想问问大家,eaccelerator和zendOptimizer或者ZendGuardLoader,哪个好点,在网上看了,也可以一起装,疑惑了?

加载中
0
1001
1001
所以你得装5.2.17
0
mark35
mark35
用APC或者xcache吧,ea兼容性不太好
0
deleted
deleted

ea默认就能装,和什么冲突了吧

0
嘟嘟的米
嘟嘟的米
一直在用ea感觉还不错 兼容问题是自己没装好的问题 重头编译很少出问题
0
Risol
Risol
用APC吧
0
c
cana
eaccelerator支持php-fpm的加速的
0
qycms_cn
qycms_cn
eaccelerator不支持php-fpm的加速!

这个哪里有说明?

 

#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

# Check if user is root
if [ $(id -u) != "0" ]; then
    echo "Error: You must be root to run this script, please use root to install lnmp"
    exit 1
fi

clear
printf "=======================================================================\n"
printf "Install eAcesselerator for LNMP V0.8  ,  Written by Licess \n"
printf "=======================================================================\n"
printf "LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux \n"
printf "This script is a tool to install eAccelerator for lnmp \n"
printf "\n"
printf "For more information please visit http://www.lnmp.org \n"
printf "=======================================================================\n"
cur_dir=$(pwd)

	ver="old"
	echo "Which version do you want to install:"
	echo "Install eaccelerator 0.9.5.3 please type: old"
	echo "Install eaccelerator 0.9.6.1 please type: new"
	read -p "Type old or new (Default version old):" ver
	if [ "$ver" = "" ]; then
		ver="old"
	fi

	if [ "$ver" = "old" ]; then
		echo "You will install eaccelerator 0.9.5.3"
	else
		echo "You will install eaccelerator 0.9.6.1"
	fi

	get_char()
	{
	SAVEDSTTY=`stty -g`
	stty -echo
	stty cbreak
	dd if=/dev/tty bs=1 count=1 2> /dev/null
	stty -raw
	stty echo
	stty $SAVEDSTTY
	}
	echo ""
	echo "Press any key to start...or Press Ctrl+c to cancel"
	char=`get_char`

printf "=========================== install eaccelerator ======================\n"

if [ -s /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so ]; then
rm -f /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so
elif [ -s /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so ]; then
rm -f /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so
fi

#Install eaccelerator 0.9.5.3
function install_old_ea {
if [ -s eaccelerator-0.9.5.3 ]; then
rm -rf eaccelerator-0.9.5.3/
fi
now_php_version=`php -r 'echo PHP_VERSION;'`
echo $now_php_version | grep '5.3.*'
if [ $? -eq 0 ]; then
echo "PHP 5.3.* Can't install eaccelerator 0.9.5.3!"
exit 1
fi
wget -c http://soft.vpser.net/web/eaccelerator/eaccelerator-0.9.5.3.tar.bz2
tar jxvf eaccelerator-0.9.5.3.tar.bz2
cd eaccelerator-0.9.5.3/
/usr/local/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config --with-eaccelerator-shared-memory
make
make install
cd ../
}

#Install eaccelerator 0.9.6.1
function install_new_ea {
if [ -s eaccelerator-0.9.6.1 ]; then
rm -rf eaccelerator-0.9.6.1/
fi

wget -c http://soft.vpser.net/web/eaccelerator/eaccelerator-0.9.6.1.tar.bz2
tar jxvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1/
/usr/local/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config --with-eaccelerator-shared-memory
make
make install
cd ../
}

if [ "$ver" = "old" ]; then
	install_old_ea
else
	install_new_ea	
fi


mkdir -p /usr/local/eaccelerator_cache
sed -ni '1,/;eaccelerator/p;/;ionCube/,$ p' /usr/local/php/etc/php.ini

php_version=`php -r 'echo PHP_VERSION;'`

if [ $php_version = "5.2.14" ] || [ $php_version = "5.2.15" ] || [ $php_version = "5.2.16" ] || [ $php_version = "5.2.17" ]; then
cat >ea.ini<<EOF
[eaccelerator]
zend_extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="1"
eaccelerator.cache_dir="/usr/local/eaccelerator_cache"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.keys = "disk_only"
eaccelerator.sessions = "disk_only"
eaccelerator.content = "disk_only"

EOF

sed -i '/;eaccelerator/ {
r ea.ini
}' /usr/local/php/etc/php.ini

echo "Restarting php-fpm......"
/etc/init.d/php-fpm restart

else
cat >ea.ini<<EOF
[eaccelerator]
zend_extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so"
eaccelerator.shm_size="1"
eaccelerator.cache_dir="/usr/local/eaccelerator_cache"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.keys = "disk_only"
eaccelerator.sessions = "disk_only"
eaccelerator.content = "disk_only"

EOF

sed -i '/;eaccelerator/ {
r ea.ini
}' /usr/local/php/etc/php.ini

if [ -s /etc/init.d/httpd ] && [ -s /usr/local/apache ]; then
echo "Restarting Apache......"
/etc/init.d/httpd -k restart
else
echo "Restarting php-fpm......"
/etc/init.d/php-fpm restart
fi

fi

rm ea.ini
clear

printf "===================== install eaccelerator completed ===================\n"
printf "Install eAccelerator completed,enjoy it!\n"
printf "=======================================================================\n"
printf "Install eAcesselerator for LNMP V0.8  ,  Written by Licess \n"
printf "=======================================================================\n"
printf "LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux \n"
printf "This script is a tool to install eAccelerator for lnmp \n"
printf "\n"
printf "For more information please visit http://www.lnmp.org \n"
printf "=======================================================================\n"

0
郭凯
郭凯

引用来自“false”的答案

ea默认就能装,和什么冲突了吧

大哥,你是怎么装的呀,下面是我的phpinfo截图,我装了ea好久都没装上去。。。
郭凯
郭凯
@false : 不应该是php-fpm的日志 吧?它怎么会去加载ea呢??而且我查看了下没有。。。
deleted
deleted
@郭凯 : 那fpm日志里有没有加载失败之类的错误?
郭凯
郭凯
@false : 没有什么错误提示。我也是按照那个步骤做去下的。我真不知道问题是出在哪儿?
deleted
deleted
就是很普通的phpize,configure,make,make install,改php.ini这流程做下来的, 没碰到问题, 你装不上有什么错误提示么?
0
公亮
公亮
ea不支持高版本的php
0
嘎子
PHP 5.3.13 (fpm-fcgi) (built: Aug 20 2012 00:25:41)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

    with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator

#######我这个算不算高版本

返回顶部
顶部