diff --git a/plugins/php/conf/php56.ini b/plugins/php/conf/php5.ini similarity index 96% rename from plugins/php/conf/php56.ini rename to plugins/php/conf/php5.ini index a08f58d34..aa25aa20b 100644 --- a/plugins/php/conf/php56.ini +++ b/plugins/php/conf/php5.ini @@ -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 diff --git a/plugins/php/conf/php72.ini b/plugins/php/conf/php7.ini similarity index 96% rename from plugins/php/conf/php72.ini rename to plugins/php/conf/php7.ini index 8a6d7e60b..810a8e3a4 100644 --- a/plugins/php/conf/php72.ini +++ b/plugins/php/conf/php7.ini @@ -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 diff --git a/plugins/php/index.py b/plugins/php/index.py index 32f571141..abc87266a 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -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) diff --git a/plugins/php/info.json b/plugins/php/info.json index 54b3b4045..fdaed8ec3 100755 --- a/plugins/php/info.json +++ b/plugins/php/info.json @@ -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", diff --git a/plugins/php/js/php.js b/plugins/php/js/php.js index c352c8037..869160058 100755 --- a/plugins/php/js/php.js +++ b/plugins/php/js/php.js @@ -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; diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh new file mode 100755 index 000000000..a6ded6315 --- /dev/null +++ b/plugins/php/versions/53/install.sh @@ -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 diff --git a/plugins/php/versions/53/redis.sh b/plugins/php/versions/53/redis.sh new file mode 100755 index 000000000..47544c9f8 --- /dev/null +++ b/plugins/php/versions/53/redis.sh @@ -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 \ No newline at end of file diff --git a/plugins/php/versions/54/install.sh b/plugins/php/versions/54/install.sh new file mode 100755 index 000000000..de61cbd86 --- /dev/null +++ b/plugins/php/versions/54/install.sh @@ -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 diff --git a/plugins/php/versions/54/redis.sh b/plugins/php/versions/54/redis.sh new file mode 100755 index 000000000..47544c9f8 --- /dev/null +++ b/plugins/php/versions/54/redis.sh @@ -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 \ No newline at end of file diff --git a/plugins/php/versions/55/install.sh b/plugins/php/versions/55/install.sh new file mode 100755 index 000000000..946fa0559 --- /dev/null +++ b/plugins/php/versions/55/install.sh @@ -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 diff --git a/plugins/php/versions/55/redis.sh b/plugins/php/versions/55/redis.sh new file mode 100755 index 000000000..47544c9f8 --- /dev/null +++ b/plugins/php/versions/55/redis.sh @@ -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 \ No newline at end of file diff --git a/plugins/php/versions/70/install.sh b/plugins/php/versions/70/install.sh new file mode 100755 index 000000000..2357b7608 --- /dev/null +++ b/plugins/php/versions/70/install.sh @@ -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 diff --git a/plugins/php/versions/70/redis.sh b/plugins/php/versions/70/redis.sh new file mode 100755 index 000000000..47544c9f8 --- /dev/null +++ b/plugins/php/versions/70/redis.sh @@ -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 \ No newline at end of file diff --git a/plugins/php/versions/71/install.sh b/plugins/php/versions/71/install.sh new file mode 100755 index 000000000..f18ace064 --- /dev/null +++ b/plugins/php/versions/71/install.sh @@ -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 diff --git a/plugins/php/versions/71/redis.sh b/plugins/php/versions/71/redis.sh new file mode 100755 index 000000000..47544c9f8 --- /dev/null +++ b/plugins/php/versions/71/redis.sh @@ -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 \ No newline at end of file diff --git a/plugins/php/versions/52/install.sh b/plugins/php/versions/73/install.sh similarity index 59% rename from plugins/php/versions/52/install.sh rename to plugins/php/versions/73/install.sh index a3169914d..fb1747d38 100755 --- a/plugins/php/versions/52/install.sh +++ b/plugins/php/versions/73/install.sh @@ -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} diff --git a/plugins/php/versions/73/redis.sh b/plugins/php/versions/73/redis.sh new file mode 100755 index 000000000..47544c9f8 --- /dev/null +++ b/plugins/php/versions/73/redis.sh @@ -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 \ No newline at end of file diff --git a/plugins/rsyncd/index.py b/plugins/rsyncd/index.py index 5f06966ec..f33d2a063 100755 --- a/plugins/rsyncd/index.py +++ b/plugins/rsyncd/index.py @@ -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' diff --git a/scripts/install_centos.sh b/scripts/install_centos.sh index 8b1b014fd..90acb6f7b 100755 --- a/scripts/install_centos.sh +++ b/scripts/install_centos.sh @@ -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 diff --git a/scripts/install_macos.sh b/scripts/install_macos.sh index 00fff17dd..95a585eea 100755 --- a/scripts/install_macos.sh +++ b/scripts/install_macos.sh @@ -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)"