Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.9.2 merge #1

Merged
merged 19 commits into from
Sep 24, 2014
10 changes: 10 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
###版本`2.9.2`:`Release date:2014/09/24`
更新记录:

* 1、新增 PHP 版本 5.3.29, 5.5.17 支持;
* 2、新增 MySQL 版本 5.5.39 支持;
* 3、优化 MySQL 和 MariaDB 的升级脚本;
* 4、优化 ZendGuardLoader,Xcache,OCI8,ionCube PHP Loader,ImageMagick 脚本,对应 PHP 各版本;
* 5、升级 Xcache 至版本 3.2.0;
* 6、新增 opcache.sh 脚本,一键安装 Zend OPcache;

###版本`2.9.1`:`Release date:2014/09/22`
更新记录:

Expand Down
19 changes: 17 additions & 2 deletions ImageMagick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#===============================================================================
# SYSTEM REQUIRED: CentOS-5 (32bit/64bit) or CentOS-6 (32bit/64bit)
# SYSTEM REQUIRED: CentOS / RedHat / Fedora
# DESCRIPTION: ImageMagick for LAMP
# AUTHOR: Teddysun <[email protected]>
# VISIT: http://teddysun.com/lamp
Expand All @@ -14,6 +14,21 @@ cd $cur_dir
ImageMagick_Ver='ImageMagick-6.8.9-8'
ImageMagick_ext_Ver='imagick-3.2.0RC1'

# get PHP version
PHP_VER=$(php -r 'echo PHP_VERSION;' 2>/dev/null | awk -F. '{print $1$2}')
if [ $? -ne 0 -o -z $PHP_VER ]; then
echo "Error:PHP looks like not installed, please check it and try again."
exit 1
fi
# get PHP extensions date
if [ $PHP_VER -eq 53 ]; then
extDate='20090626'
elif [ $PHP_VER -eq 54 ]; then
extDate='20100525'
elif [ $PHP_VER -eq 55 ]; then
extDate='20121212'
fi

#===============================================================================
#DESCRIPTION:Make sure only root can run our script
#USAGE:rootness
Expand Down Expand Up @@ -66,7 +81,7 @@ function install_imagemagick_ext(){
echo "imagemagick configuration not found, create it!"
cat > $PHP_PREFIX/php.d/imagick.ini<<-EOF
[imagick]
extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/imagick.so
extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-${extDate}/imagick.so
EOF
fi
# Clean up
Expand Down
45 changes: 23 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* 服务器必须配置好软件源和可连接外网
* 必须具有系统 Root 权限
* 建议使用干净系统全新安装
* 日期:2014年09月22日
* 日期:2014年09月24日

## 关于本脚本
* 支持 PHP 自带所有组件;
* 支持 MySQL ,MariaDB, SQLite 数据库;
* 支持 XCache (可选安装);
* 支持 XCache ,Zend OPcache(可选安装);
* 支持 Zend Guard Loader (可选安装);
* 支持 OCI8 (可让 PHP 连接 Oracle 数据库,可选安装);
* 支持 ionCube PHP Loader (可选安装);
Expand All @@ -25,21 +25,22 @@
* 一键卸载。

## 将会安装
* 1、Apache 2.4.10
* 2、MySQL 5.6.20, MariaDB 5.5.39, MariaDB 10.0.13 (三选一安装
* 3、PHP 5.4.33
* 4、phpMyAdmin 4.2.9
* 5、xcache 3.1.0 (推荐安装)
* 6、OCI8 2.0.8 (可选安装)
* 7、pure-ftpd 1.0.36 (可选安装)
* 8、Zend Guard Loader 3.3( 可选安装)
* 9、ionCube PHP Loader 4.6.1 (可选安装)
* 1、Apache 2.4.10
* 2、MySQL 5.6.20, MySQL 5.5.39, MariaDB 5.5.39, MariaDB 10.0.13 (四选一安装
* 3、PHP 5.4.33, PHP 5.3.29, PHP 5.5.17 (三选一安装)
* 4、phpMyAdmin 4.2.9
* 5、xcache 3.2.0 (推荐安装)
* 6、OCI8 2.0.8 (可选安装)
* 7、pure-ftpd 1.0.36 (可选安装)
* 8、Zend Guard Loader 3.3( 可选安装)
* 9、ionCube PHP Loader 4.6.1 (可选安装)
* 10、ImageMagick-6.8.9-8 (可选安装)
* 11、Zend OPcache 7.0.3 (可选安装)

## 如何安装
### 事前准备(安装screen、unzip,创建 screen 会话):

yum -y install screen unzip
yum -y install wget screen unzip
screen -S lamp

### 第一步,下载、解压、赋予权限:
Expand All @@ -56,15 +57,16 @@

### 安装其它:

* 1、(推荐安装)执行脚本 xcache.sh 安装 xcache 。(命令:./xcache.sh)
* 2、(可选安装)执行脚本 oci8_oracle11g.sh 安装 OCI8 扩展以及 oracle-instantclient11.2(命令:./oci8_oracle11g.sh)
* 3、(可选安装)执行脚本 pureftpd.sh 安装 pure-ftpd-1.0.36。(命令:./pureftpd.sh)
* 4、(可选安装)执行脚本 ZendGuardLoader.sh 安装 Zend Guard Loader。(命令:./ZendGuardLoader.sh)
* 5、(可选安装)执行脚本 ioncube.sh 安装 ionCube PHP Loader。(命令:./ioncube.sh)
* 6、(可选安装)执行脚本 ImageMagick.sh 安装 ImageMagick 的 PHP 扩展。(命令:./ImageMagick.sh)
* 7、(升级脚本)执行脚本 upgrade_php.sh 将会升级 PHP 和 phpMyAdmin 至最新版本。(命令:./upgrade_php.sh | tee upgrade_php.log)
* 8、(升级脚本)执行脚本 upgrade_mysql.sh 将会升级 MySQL 至 5.6.x 的最新版本。(命令:./upgrade_mysql.sh | tee upgrade_mysql.log)
* 9、(升级脚本)执行脚本 upgrade_mariadb.sh 将会升级 MariaDB 至已安装版本相对应的最新版本。(命令:./upgrade_mariadb.sh | tee upgrade_mariadb.log)
* 1、(推荐安装)执行脚本 xcache.sh 安装 xcache 。(命令:./xcache.sh)
* 2、(可选安装)执行脚本 oci8_oracle11g.sh 安装 OCI8 扩展以及 oracle-instantclient11.2(命令:./oci8_oracle11g.sh)
* 3、(可选安装)执行脚本 pureftpd.sh 安装 pure-ftpd-1.0.36。(命令:./pureftpd.sh)
* 4、(可选安装)执行脚本 ZendGuardLoader.sh 安装 Zend Guard Loader。(命令:./ZendGuardLoader.sh)
* 5、(可选安装)执行脚本 ioncube.sh 安装 ionCube PHP Loader。(命令:./ioncube.sh)
* 6、(可选安装)执行脚本 ImageMagick.sh 安装 imagick 的 PHP 扩展。(命令:./ImageMagick.sh)
* 7、(可选安装)执行脚本 opcache.sh 安装 Zend OPcache 的 PHP 扩展。(命令:./opcache.sh)
* 8、(升级脚本)执行脚本 upgrade_php.sh 将会升级 PHP 和 phpMyAdmin 至最新版本。(命令:./upgrade_php.sh | tee upgrade_php.log)
* 9、(升级脚本)执行脚本 upgrade_mysql.sh 将会升级 MySQL 至 5.6.x 的最新版本。(命令:./upgrade_mysql.sh | tee upgrade_mysql.log)
* 10、(升级脚本)执行脚本 upgrade_mariadb.sh 将会升级 MariaDB 至已安装版本相对应的最新版本。(命令:./upgrade_mariadb.sh | tee upgrade_mariadb.log)

### 关于 upgrade_php.sh

Expand All @@ -82,7 +84,6 @@

./upgrade_mysql.sh | tee upgrade_mysql.log


### 关于 upgrade_mariadb.sh

新增 upgrade_mariadb.sh 脚本,目的是为了自动检测和升级 MariaDB。升级之前自动备份全部数据库,在升级完成之后再将备份恢复。
Expand Down
61 changes: 48 additions & 13 deletions ZendGuardLoader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#===============================================================================================
# SYSTEM REQUIRED: CentOS-5 (32bit/64bit) or CentOS-6 (32bit/64bit)
# SYSTEM REQUIRED: CentOS / RedHat / Fedora
# DESCRIPTION: ZendGuardLoader for LAMP
# AUTHOR: Teddysun <[email protected]>
# VISIT: http://teddysun.com/lamp
Expand All @@ -15,6 +15,15 @@ fi
cur_dir=`pwd`
cd $cur_dir

# is 64bit or not
function is_64bit(){
if [ `getconf WORD_BIT` = '32' ] && [ `getconf LONG_BIT` = '64' ] ; then
return 0
else
return 1
fi
}

clear
echo "#############################################################"
echo "# ZendGuardLoader for LAMP"
Expand All @@ -25,33 +34,59 @@ echo "#"
echo "#############################################################"
echo ""

# get PHP version
INSTALLED_PHP=$(php -r 'echo PHP_VERSION;' 2>/dev/null | awk -F. '{print $1$2}')
if [ $? -ne 0 -o -z $INSTALLED_PHP ]; then
echo "Error:PHP looks like not installed, please check it and try again."
exit 1
fi

# get PHP extensions date & ZendGuardLoader version
if [ $INSTALLED_PHP -eq 53 ]; then
if is_64bit; then
zendVer="ZendGuardLoader-php-5.3-linux-glibc23-x86_64"
else
zendVer="ZendGuardLoader-php-5.3-linux-glibc23-i386"
fi
phpVer='5.3'
extDate='20090626'
elif [ $INSTALLED_PHP -eq 54 ]; then
if is_64bit; then
zendVer="ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64"
else
zendVer="ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386"
fi
phpVer='5.4'
extDate='20100525'
elif [ $INSTALLED_PHP -eq 55 ]; then
echo "Error:PHP 5.5 is not support!"
echo ""
exit 1
fi

# Install ZendGuardLoader
echo "============================ZendGuardLoader install start====================================="
if [ ! -d $cur_dir/untar/ ]; then
mkdir -p $cur_dir/untar/
fi
# Download ZendGuardLoader
if [ `getconf WORD_BIT` = '32' ] && [ `getconf LONG_BIT` = '64' ] ; then
if ! wget -c http://lamp.teddysun.com/files/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz;then
echo "Failed to download ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz, please download it to "$cur_dir" directory manually and rerun the install script."
exit 1
fi
tar zxf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz -C $cur_dir/untar/
mv $cur_dir/untar/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64/php-5.4.x/ZendGuardLoader.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
if [ -s ${zendVer}.tar.gz ]; then
echo "${zendVer}.tar.gz [found]"
else
if ! wget -c http://lamp.teddysun.com/files/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz;then
echo "Failed to download ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz, please download it to "$cur_dir" directory manually and rerun the install script."
echo "${zendVer}.tar.gz not found!!!download now......"
if ! wget -c http://lamp.teddysun.com/files/${zendVer}.tar.gz; then
echo "Failed to download ${zendVer}.tar.gz, please download it to "$cur_dir" directory manually and try again."
exit 1
fi
tar zxf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz -C $cur_dir/untar/
mv $cur_dir/untar/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386/php-5.4.x/ZendGuardLoader.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
fi
tar zxf ${zendVer}.tar.gz -C $cur_dir/untar/
mv $cur_dir/untar/${zendVer}/php-${phpVer}.x/ZendGuardLoader.so /usr/local/php/lib/php/extensions/no-debug-non-zts-${extDate}/

if [ ! -f /usr/local/php/php.d/zend.ini ]; then
echo "Zend Guard Loader configuration not found, create it!"
cat > /usr/local/php/php.d/zend.ini<<-EOF
[Zend Guard]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/ZendGuardLoader.so
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-${extDate}/ZendGuardLoader.so

zend_loader.enable = 1
zend_loader.disable_licensing = 0
Expand Down
55 changes: 44 additions & 11 deletions ioncube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ fi
cur_dir=`pwd`
cd $cur_dir

# is 64bit or not
function is_64bit(){
if [ `getconf WORD_BIT` = '32' ] && [ `getconf LONG_BIT` = '64' ] ; then
return 0
else
return 1
fi
}

clear
echo "#############################################################"
echo "# ionCube for LAMP"
Expand All @@ -25,33 +34,57 @@ echo "#"
echo "#############################################################"
echo ""

# get PHP version
INSTALLED_PHP=$(php -r 'echo PHP_VERSION;' 2>/dev/null | awk -F. '{print $1$2}')
if [ $? -ne 0 -o -z $INSTALLED_PHP ]; then
echo "Error:PHP looks like not installed, please check it and try again."
exit 1
fi

# get PHP extensions date
if [ $INSTALLED_PHP -eq 53 ]; then
phpVer='5.3'
extDate='20090626'
elif [ $INSTALLED_PHP -eq 54 ]; then
phpVer='5.4'
extDate='20100525'
elif [ $INSTALLED_PHP -eq 55 ]; then
phpVer='5.5'
extDate='20121212'
fi
if is_64bit; then
ionCubeVer='ioncube_loaders_lin_x86-64.tar.gz'
else
ionCubeVer='ioncube_loaders_lin_x86.tar.gz'
fi

# Install ionCube
echo "============================ionCube install start====================================="
if [ ! -d $cur_dir/untar/ ]; then
mkdir -p $cur_dir/untar/
fi
# Download ionCube
if [ `getconf WORD_BIT` = '32' ] && [ `getconf LONG_BIT` = '64' ] ; then
if ! wget -c http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz; then
echo "Failed to download ioncube_loaders_lin_x86-64.tar.gz, please download it to $cur_dir directory manually and try again."
exit 1
fi
tar zxf ioncube_loaders_lin_x86-64.tar.gz -C $cur_dir/untar/
if [ -s ${ionCubeVer} ]; then
echo "${ionCubeVer} [found]"
else
if ! wget -c http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz; then
echo "Failed to download ioncube_loaders_lin_x86.tar.gz, please download it to $cur_dir directory manually and try again."
echo "${ionCubeVer} not found!!!download now......"
if ! wget -c http://lamp.teddysun.com/files/${ionCubeVer}; then
echo "Failed to download ${ionCubeVer}, please download it to "$cur_dir" directory manually and try again."
exit 1
fi
tar zxf ioncube_loaders_lin_x86.tar.gz -C $cur_dir/untar/
fi

tar zxf ${ionCubeVer} -C $cur_dir/untar/

# Copy file
cp -pf $cur_dir/untar/ioncube/ioncube_loader_lin_5.4.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
cp -pf $cur_dir/untar/ioncube/ioncube_loader_lin_$phpVer.so /usr/local/php/lib/php/extensions/no-debug-non-zts-$extDate/

# Create configuration file
if [ ! -f /usr/local/php/php.d/ioncube.ini ]; then
echo "ionCube configuration not found, create it!"
cat > /usr/local/php/php.d/ioncube.ini<<-EOF
[ionCube Loader]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/ioncube_loader_lin_5.4.so
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-${extDate}/ioncube_loader_lin_${phpVer}.so
EOF
fi
# Clean up
Expand Down
Loading