pull/109/head
Mr Chen 6 years ago
parent 7d58b1dcbe
commit 75532bb0f9
  1. 2
      plugins/php/conf/php5.ini
  2. 2
      plugins/php/conf/php7.ini
  3. 2
      plugins/php/index.py
  4. 4
      plugins/php/info.json
  5. 8
      plugins/php/js/php.js
  6. 67
      plugins/php/versions/53/install.sh
  7. 90
      plugins/php/versions/53/redis.sh
  8. 65
      plugins/php/versions/54/install.sh
  9. 90
      plugins/php/versions/54/redis.sh
  10. 66
      plugins/php/versions/55/install.sh
  11. 90
      plugins/php/versions/55/redis.sh
  12. 67
      plugins/php/versions/70/install.sh
  13. 90
      plugins/php/versions/70/redis.sh
  14. 65
      plugins/php/versions/71/install.sh
  15. 90
      plugins/php/versions/71/redis.sh
  16. 24
      plugins/php/versions/73/install.sh
  17. 90
      plugins/php/versions/73/redis.sh
  18. 6
      plugins/rsyncd/index.py
  19. 2
      scripts/install_centos.sh
  20. 2
      scripts/install_macos.sh

@ -45,7 +45,7 @@ allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
disable_functions = phpinfo,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
[CLI Server]
cli_server.color = On

@ -44,7 +44,7 @@ allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
disable_functions = phpinfo,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
[CLI Server]
cli_server.color = On

@ -158,7 +158,7 @@ def phpFpmWwwReplace(version):
def makePhpIni(version):
d_ini = public.getServerDir() + '/php/' + version + '/etc/php.ini'
if not os.path.exists(d_ini):
s_ini = getPluginDir() + '/conf/php' + version + '.ini'
s_ini = getPluginDir() + '/conf/php' + version[0:1] + '.ini'
shutil.copyfile(s_ini, d_ini)

@ -5,8 +5,8 @@
"name": "php",
"title": "PHP",
"coexist": true,
"versions": ["52","56","72"],
"updates": ["5.2.17","5.6.36","7.2.0"],
"versions": ["53","54","55","56","70","71","72","73"],
"updates": ["5.3.17","5.4.45","5.6.36","7.0.30","7.1.","7.2.0"],
"tip": "soft",
"checks": "server/php/VERSION/bin/php",
"path": "server/php/VERSION",

@ -441,10 +441,16 @@ function phpLibConfig(version){
phpPost('get_lib_conf', version, '', function(data){
var rdata = $.parseJSON(data.data);
var libs = rdata.data;
if (!rdata.status){
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
return;
}
var libs = rdata.data;
var body = '';
var opt = '';
for (var i = 0; i < libs.length; i++) {
if (libs[i].versions.indexOf(version) == -1){
continue;

@ -0,0 +1,67 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source
install_tmp=${rootPath}/tmp/bt_install.pl
# echo $curPath
# echo ${1}
# echo ${serverPath}
# echo ${install_tmp}
Install_php()
{
#------------------------ install start ------------------------------------#
echo "安装php-5.3.29 ..." > $install_tmp
mkdir -p $sourcePath/php
mkdir -p $serverPath/php
if [ ! -f $sourcePath/php/php-5.3.29.tar.xz ];then
wget -O $sourcePath/php/php-5.3.29.tar.xz https://museum.php.net/php5/php-5.3.29.tar.xz
fi
if [ ! -d $sourcePath/php/php-5.3.29 ];then
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-5.3.29.tar.xz
fi
cd $sourcePath/php/php-5.3.29 && ./configure \
--prefix=$serverPath/php/53 \
--exec-prefix=$serverPath/php/53 \
--with-config-file-path=$serverPath/php/53/etc \
--with-zlib-dir=$serverPath/lib/zlib \
--enable-mysqlnd \
--without-iconv \
--enable-zip \
--enable-mbstring \
--enable-ftp \
--enable-wddx \
--enable-soap \
--enable-posix \
--enable-fpm \
&& make && make install && make clean
#------------------------ install end ------------------------------------#
}
Uninstall_php()
{
rm -rf $serverPath/php/53
echo "卸载php-5.3.29 ..." > $install_tmp
}
action=${1}
if [ "${1}" == 'install' ];then
Install_php
else
Uninstall_php
fi

@ -0,0 +1,90 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
LIBNAME=redis
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/
Install_lib()
{
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"`
if [ "${isInstall}" != "" ];then
echo "php$version 已安装${LIBNAME},请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
php_lib=$sourcePath/php_${version}_lib
mkdir -p $php_lib
if [ ! -f $php_lib/redis-4.2.0.tgz ];then
wget -O $php_lib/redis-4.2.0.tgz http://pecl.php.net/get/redis-4.2.0.tgz
fi
cd $php_lib && tar xvf redis-4.2.0.tgz
cd redis-4.2.0
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config
make && make install
cd $php_lib
rm -rf redis-*
rm -f package.xml
fi
sleep 1
if [ ! -f "$extFile" ];then
echo "ERROR!"
return
fi
echo "extension=redis.so" >> $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==========================================================='
echo 'successful!'
}
Uninstall_lib()
{
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
echo "php$version 未安装,请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
echo "php$version 未安装${LIBNAME},请选择其它版本!"
echo "php-$vphp not install memcache, Plese select other version!"
return
fi
sed -i '_bak' '/redis.so/d' $serverPath/php/$version/etc/php.ini
rm -f $extFile
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi

@ -0,0 +1,65 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source
install_tmp=${rootPath}/tmp/bt_install.pl
# echo $curPath
# echo ${1}
# echo ${serverPath}
# echo ${install_tmp}
Install_php()
{
#------------------------ install start ------------------------------------#
echo "安装php-7.2.5 ..." > $install_tmp
mkdir -p $sourcePath/php
mkdir -p $serverPath/php
if [ ! -f $sourcePath/php/php-5.4.45.tar.gz ];then
wget -O $sourcePath/php/php-5.4.45.tar.gz https://museum.php.net/php5/php-5.4.45.tar.gz
fi
if [ ! -d $sourcePath/php/php-5.4.45 ];then
cd $sourcePath/php && tar -zvxf $sourcePath/php/php-5.4.45.tar.gz
fi
cd $sourcePath/php/php-5.4.45 && ./configure \
--prefix=$serverPath/php/54 \
--exec-prefix=$serverPath/php/54 \
--with-config-file-path=$serverPath/php/54/etc \
--with-zlib-dir=$serverPath/lib/zlib \
--enable-mysqlnd \
--without-iconv \
--enable-zip \
--enable-mbstring \
--enable-ftp \
--enable-wddx \
--enable-soap \
--enable-posix \
--enable-fpm \
&& make && make install && make clean
#------------------------ install end ------------------------------------#
}
Uninstall_php()
{
rm -rf $serverPath/php/54
echo "卸载php-5.4.45 ..." > $install_tmp
}
action=${1}
if [ "${1}" == 'install' ];then
Install_php
else
Uninstall_php
fi

@ -0,0 +1,90 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
LIBNAME=redis
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/
Install_lib()
{
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"`
if [ "${isInstall}" != "" ];then
echo "php$version 已安装${LIBNAME},请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
php_lib=$sourcePath/php_${version}_lib
mkdir -p $php_lib
if [ ! -f $php_lib/redis-4.2.0.tgz ];then
wget -O $php_lib/redis-4.2.0.tgz http://pecl.php.net/get/redis-4.2.0.tgz
fi
cd $php_lib && tar xvf redis-4.2.0.tgz
cd redis-4.2.0
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config
make && make install
cd $php_lib
rm -rf redis-*
rm -f package.xml
fi
sleep 1
if [ ! -f "$extFile" ];then
echo "ERROR!"
return
fi
echo "extension=redis.so" >> $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==========================================================='
echo 'successful!'
}
Uninstall_lib()
{
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
echo "php$version 未安装,请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
echo "php$version 未安装${LIBNAME},请选择其它版本!"
echo "php-$vphp not install memcache, Plese select other version!"
return
fi
sed -i '_bak' '/redis.so/d' $serverPath/php/$version/etc/php.ini
rm -f $extFile
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi

@ -0,0 +1,66 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source
install_tmp=${rootPath}/tmp/bt_install.pl
# echo $curPath
# echo ${1}
# echo ${serverPath}
# echo ${install_tmp}
Install_php()
{
#------------------------ install start ------------------------------------#
echo "安装php-5.5.38 ..." > $install_tmp
mkdir -p $sourcePath/php
mkdir -p $serverPath/php
if [ ! -f $sourcePath/php/php-5.5.38.tar.xz ];then
wget -O $sourcePath/php/php-5.5.38.tar.xz https://museum.php.net/php5/php-5.5.38.tar.xz
fi
if [ ! -d $sourcePath/php/php-5.5.38 ];then
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-5.5.38.tar.xz
fi
cd $sourcePath/php/php-5.5.38 && ./configure \
--prefix=$serverPath/php/55 \
--exec-prefix=$serverPath/php/55 \
--with-config-file-path=$serverPath/php/55/etc \
--with-zlib-dir=$serverPath/lib/zlib \
--enable-mysqlnd \
--without-iconv \
--enable-zip \
--enable-mbstring \
--enable-ftp \
--enable-wddx \
--enable-soap \
--enable-posix \
--enable-fpm \
&& make && make install && make clean
#------------------------ install end ------------------------------------#
}
Uninstall_php()
{
rm -rf $serverPath/php/55
echo "卸载php-5.5.38 ..." > $install_tmp
}
action=${1}
if [ "${1}" == 'install' ];then
Install_php
else
Uninstall_php
fi

@ -0,0 +1,90 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
LIBNAME=redis
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/
Install_lib()
{
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"`
if [ "${isInstall}" != "" ];then
echo "php$version 已安装${LIBNAME},请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
php_lib=$sourcePath/php_${version}_lib
mkdir -p $php_lib
if [ ! -f $php_lib/redis-4.2.0.tgz ];then
wget -O $php_lib/redis-4.2.0.tgz http://pecl.php.net/get/redis-4.2.0.tgz
fi
cd $php_lib && tar xvf redis-4.2.0.tgz
cd redis-4.2.0
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config
make && make install
cd $php_lib
rm -rf redis-*
rm -f package.xml
fi
sleep 1
if [ ! -f "$extFile" ];then
echo "ERROR!"
return
fi
echo "extension=redis.so" >> $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==========================================================='
echo 'successful!'
}
Uninstall_lib()
{
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
echo "php$version 未安装,请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
echo "php$version 未安装${LIBNAME},请选择其它版本!"
echo "php-$vphp not install memcache, Plese select other version!"
return
fi
sed -i '_bak' '/redis.so/d' $serverPath/php/$version/etc/php.ini
rm -f $extFile
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi

@ -0,0 +1,67 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source
install_tmp=${rootPath}/tmp/bt_install.pl
# echo $curPath
# echo ${1}
# echo ${serverPath}
# echo ${install_tmp}
Install_php()
{
#------------------------ install start ------------------------------------#
echo "安装php-7.0.30 ..." > $install_tmp
mkdir -p $sourcePath/php
mkdir -p $serverPath/php
if [ ! -f $sourcePath/php/php-7.0.30.tar.xz ];then
wget -O $sourcePath/php/php-7.0.30.tar.xz https://museum.php.net/php7/php-7.0.30.tar.xz
fi
if [ ! -d $sourcePath/php/php-7.0.30 ];then
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-7.0.30.tar.xz
fi
cd $sourcePath/php/php-7.0.30 && ./configure \
--prefix=$serverPath/php/70 \
--exec-prefix=$serverPath/php/70 \
--with-config-file-path=$serverPath/php/70/etc \
--with-zlib-dir=$serverPath/lib/zlib \
--enable-mysqlnd \
--without-iconv \
--enable-zip \
--enable-mbstring \
--enable-ftp \
--enable-wddx \
--enable-soap \
--enable-posix \
--enable-fpm \
&& make && make install && make clean
#------------------------ install end ------------------------------------#
}
Uninstall_php()
{
rm -rf $serverPath/php/70
echo "卸载php-7.0.30 ..." > $install_tmp
}
action=${1}
if [ "${1}" == 'install' ];then
Install_php
else
Uninstall_php
fi

@ -0,0 +1,90 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
LIBNAME=redis
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/
Install_lib()
{
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"`
if [ "${isInstall}" != "" ];then
echo "php$version 已安装${LIBNAME},请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
php_lib=$sourcePath/php_${version}_lib
mkdir -p $php_lib
if [ ! -f $php_lib/redis-4.2.0.tgz ];then
wget -O $php_lib/redis-4.2.0.tgz http://pecl.php.net/get/redis-4.2.0.tgz
fi
cd $php_lib && tar xvf redis-4.2.0.tgz
cd redis-4.2.0
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config
make && make install
cd $php_lib
rm -rf redis-*
rm -f package.xml
fi
sleep 1
if [ ! -f "$extFile" ];then
echo "ERROR!"
return
fi
echo "extension=redis.so" >> $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==========================================================='
echo 'successful!'
}
Uninstall_lib()
{
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
echo "php$version 未安装,请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
echo "php$version 未安装${LIBNAME},请选择其它版本!"
echo "php-$vphp not install memcache, Plese select other version!"
return
fi
sed -i '_bak' '/redis.so/d' $serverPath/php/$version/etc/php.ini
rm -f $extFile
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi

@ -0,0 +1,65 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source
install_tmp=${rootPath}/tmp/bt_install.pl
# echo $curPath
# echo ${1}
# echo ${serverPath}
# echo ${install_tmp}
Install_php()
{
#------------------------ install start ------------------------------------#
echo "安装php-7.1.17 ..." > $install_tmp
mkdir -p $sourcePath/php
mkdir -p $serverPath/php
if [ ! -f $sourcePath/php/php-7.1.17.tar.xz ];then
wget -O $sourcePath/php/php-7.1.17.tar.xz https://museum.php.net/php7/php-7.1.17.tar.xz
fi
if [ ! -d $sourcePath/php/php-7.1.17 ];then
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-7.1.17.tar.xz
fi
cd $sourcePath/php/php-7.1.17 && ./configure \
--prefix=$serverPath/php/71 \
--exec-prefix=$serverPath/php/71 \
--with-config-file-path=$serverPath/php/72/etc \
--with-zlib-dir=$serverPath/lib/zlib \
--enable-mysqlnd \
--without-iconv \
--enable-zip \
--enable-mbstring \
--enable-ftp \
--enable-wddx \
--enable-soap \
--enable-posix \
--enable-fpm \
&& make && make install && make clean
#------------------------ install end ------------------------------------#
}
Uninstall_php()
{
rm -rf $serverPath/php/71
echo "卸载php-7.2.5 ..." > $install_tmp
}
action=${1}
if [ "${1}" == 'install' ];then
Install_php
else
Uninstall_php
fi

@ -0,0 +1,90 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
LIBNAME=redis
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/
Install_lib()
{
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"`
if [ "${isInstall}" != "" ];then
echo "php$version 已安装${LIBNAME},请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
php_lib=$sourcePath/php_${version}_lib
mkdir -p $php_lib
if [ ! -f $php_lib/redis-4.2.0.tgz ];then
wget -O $php_lib/redis-4.2.0.tgz http://pecl.php.net/get/redis-4.2.0.tgz
fi
cd $php_lib && tar xvf redis-4.2.0.tgz
cd redis-4.2.0
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config
make && make install
cd $php_lib
rm -rf redis-*
rm -f package.xml
fi
sleep 1
if [ ! -f "$extFile" ];then
echo "ERROR!"
return
fi
echo "extension=redis.so" >> $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==========================================================='
echo 'successful!'
}
Uninstall_lib()
{
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
echo "php$version 未安装,请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
echo "php$version 未安装${LIBNAME},请选择其它版本!"
echo "php-$vphp not install memcache, Plese select other version!"
return
fi
sed -i '_bak' '/redis.so/d' $serverPath/php/$version/etc/php.ini
rm -f $extFile
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi

@ -19,24 +19,25 @@ install_tmp=${rootPath}/tmp/bt_install.pl
Install_php()
{
#------------------------ install start ------------------------------------#
echo "安装php-5.2.17 ..." > $install_tmp
echo "安装php-7.3.2 ..." > $install_tmp
mkdir -p $sourcePath/php
mkdir -p $serverPath/php
if [ ! -f $sourcePath/php/php-5.2.17.tar.bz2 ];then
wget -O $sourcePath/php/php-5.2.17.tar.bz2 https://museum.php.net/php5/php-5.2.17.tar.bz2
if [ ! -f $sourcePath/php/php-7.3.2.tar.xz ];then
wget -O $sourcePath/php/php-7.3.2.tar.xz http://au1.php.net/distributions/php-7.3.2.tar.xz
fi
if [ ! -d $sourcePath/php/php-5.2.17 ];then
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-5.2.17.tar.bz2
if [ ! -d $sourcePath/php/php-7.3.2 ];then
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-7.3.2.tar.xz
fi
cd $sourcePath/php/php-5.2.17 && ./configure \
--prefix=$serverPath/php/php52 \
--exec-prefix=$serverPath/php/php52 \
--with-config-file-path=$serverPath/php/php55/etc \
cd $sourcePath/php/php-7.3.2 && ./configure \
--prefix=$serverPath/php/73 \
--exec-prefix=$serverPath/php/73 \
--with-config-file-path=$serverPath/php/73/etc \
--with-zlib-dir=$serverPath/lib/zlib \
--enable-mysqlnd \
--without-iconv \
--enable-zip \
--enable-mbstring \
@ -45,7 +46,7 @@ cd $sourcePath/php/php-5.2.17 && ./configure \
--enable-soap \
--enable-posix \
--enable-fpm \
&& make && make install
&& make && make install && make clean
#------------------------ install end ------------------------------------#
}
@ -54,7 +55,8 @@ cd $sourcePath/php/php-5.2.17 && ./configure \
Uninstall_php()
{
echo "卸载php-5.2.17 ..." > $install_tmp
rm -rf $serverPath/php/73
echo "卸载php-7.3.2 ..." > $install_tmp
}
action=${1}

@ -0,0 +1,90 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
LIBNAME=redis
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/
Install_lib()
{
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"`
if [ "${isInstall}" != "" ];then
echo "php$version 已安装${LIBNAME},请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
php_lib=$sourcePath/php_${version}_lib
mkdir -p $php_lib
if [ ! -f $php_lib/redis-4.2.0.tgz ];then
wget -O $php_lib/redis-4.2.0.tgz http://pecl.php.net/get/redis-4.2.0.tgz
fi
cd $php_lib && tar xvf redis-4.2.0.tgz
cd redis-4.2.0
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config
make && make install
cd $php_lib
rm -rf redis-*
rm -f package.xml
fi
sleep 1
if [ ! -f "$extFile" ];then
echo "ERROR!"
return
fi
echo "extension=redis.so" >> $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==========================================================='
echo 'successful!'
}
Uninstall_lib()
{
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
echo "php$version 未安装,请选择其它版本!"
return
fi
extFile=$extDir${LIBNAME}.so
if [ ! -f "$extFile" ];then
echo "php$version 未安装${LIBNAME},请选择其它版本!"
echo "php-$vphp not install memcache, Plese select other version!"
return
fi
sed -i '_bak' '/redis.so/d' $serverPath/php/$version/etc/php.ini
rm -f $extFile
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi

@ -132,8 +132,8 @@ def initdUinstall():
return 'ok'
def smbConf():
return '/etc/samba/smb.conf'
def appConf():
return '/etc/rsyncd.conf'
if __name__ == "__main__":
func = sys.argv[1]
@ -154,6 +154,6 @@ if __name__ == "__main__":
elif func == 'initd_uninstall':
print initdUinstall()
elif func == 'conf':
print smbConf()
print appConf()
else:
print 'error'

@ -60,7 +60,7 @@ yum install -y wget curl unzip zip
# fi
yum groupinstall -y "Development Tools"
paces="wget python-devel python-imaging libicu-devel zip unzip openssl openssl-devel gcc libxml2 libxml2-dev libxslt* zlib zlib-devel libjpeg-devel libpng-devel libwebp libwebp-devel freetype freetype-devel lsof pcre pcre-devel vixie-cron crontabs"
paces="wget python-devel python-imaging libicu-devel zip unzip bzip2-devel openssl openssl-devel gcc libxml2 libxml2-dev libxslt* zlib zlib-devel libjpeg-devel libpng-devel libwebp libwebp-devel freetype freetype-devel lsof pcre pcre-devel vixie-cron crontabs"
yum -y install $paces
yum -y lsof net-tools.x86_64
yum -y install ncurses-devel mysql-dev locate cmake

@ -14,6 +14,8 @@ mkdir -p $DEV/wwwlogs
mkdir -p $DEV/backup/database
mkdir -p $DEV/backup/site
brew install libzip bzip2
# install brew
if [ ! -f /usr/local/bin/brew ];then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Loading…
Cancel
Save