From 653a9297bc0f6fb90a562aeabe4b14e7744d12d3 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 30 Nov 2019 18:02:21 +0800 Subject: [PATCH] up --- plugins/php/versions/53/install.sh | 1 - plugins/php/versions/54/install.sh | 1 - plugins/php/versions/55/install.sh | 1 - plugins/php/versions/56/install.sh | 1 - plugins/php/versions/70/install.sh | 1 - plugins/php/versions/71/install.sh | 1 - plugins/php/versions/72/install.sh | 1 - plugins/php/versions/73/install.sh | 11 ++--- plugins/php/versions/74/install.sh | 8 +-- plugins/php/versions/74/pcntl.sh | 79 ++++++++++++++++++++++++++++++ plugins/php/versions/phplib.conf | 10 ++++ 11 files changed, 98 insertions(+), 17 deletions(-) create mode 100755 plugins/php/versions/74/pcntl.sh diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh index ad675f04d..5648e078a 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -73,7 +73,6 @@ if [ ! -d $serverPath/php/53 ];then --enable-bcmath \ --enable-xml \ --enable-ftp \ - --enable-wddx \ --enable-soap \ --enable-posix \ --enable-sockets \ diff --git a/plugins/php/versions/54/install.sh b/plugins/php/versions/54/install.sh index 3da73904e..13ab92fde 100755 --- a/plugins/php/versions/54/install.sh +++ b/plugins/php/versions/54/install.sh @@ -52,7 +52,6 @@ if [ ! -d $serverPath/php/54 ];then --enable-sockets \ --enable-ftp \ --enable-simplexml \ - --enable-wddx \ --enable-soap \ --enable-posix \ --enable-sysvmsg \ diff --git a/plugins/php/versions/55/install.sh b/plugins/php/versions/55/install.sh index 5ef76d69b..d0be55bc6 100755 --- a/plugins/php/versions/55/install.sh +++ b/plugins/php/versions/55/install.sh @@ -50,7 +50,6 @@ if [ ! -d $serverPath/php/55 ];then --enable-mbstring \ --enable-sockets \ --enable-ftp \ - --enable-wddx \ --enable-soap \ --enable-posix \ --enable-sysvmsg \ diff --git a/plugins/php/versions/56/install.sh b/plugins/php/versions/56/install.sh index b892ec9f1..259943556 100755 --- a/plugins/php/versions/56/install.sh +++ b/plugins/php/versions/56/install.sh @@ -56,7 +56,6 @@ if [ ! -d $serverPath/php/56 ];then --enable-pcntl \ --enable-shmop \ --enable-intl \ - --enable-wddx \ --enable-soap \ --enable-posix \ --enable-sysvmsg \ diff --git a/plugins/php/versions/70/install.sh b/plugins/php/versions/70/install.sh index e67329589..1ba1212e0 100755 --- a/plugins/php/versions/70/install.sh +++ b/plugins/php/versions/70/install.sh @@ -53,7 +53,6 @@ if [ ! -d $serverPath/php/70 ];then --enable-ftp \ --enable-sockets \ --enable-intl \ - --enable-wddx \ --enable-soap \ --enable-posix \ --enable-sysvmsg \ diff --git a/plugins/php/versions/71/install.sh b/plugins/php/versions/71/install.sh index 849d1dc13..2076910de 100755 --- a/plugins/php/versions/71/install.sh +++ b/plugins/php/versions/71/install.sh @@ -50,7 +50,6 @@ if [ ! -d $serverPath/php/71 ];then --enable-mbstring \ --enable-simplexml \ --enable-ftp \ - --enable-wddx \ --enable-sockets \ --enable-intl \ --enable-soap \ diff --git a/plugins/php/versions/72/install.sh b/plugins/php/versions/72/install.sh index 976d199d1..44dd1eb2c 100755 --- a/plugins/php/versions/72/install.sh +++ b/plugins/php/versions/72/install.sh @@ -53,7 +53,6 @@ if [ ! -d $serverPath/php/72 ];then --enable-sockets \ --enable-intl \ --enable-ftp \ - --enable-wddx \ --enable-soap \ --enable-posix \ --enable-sysvmsg \ diff --git a/plugins/php/versions/73/install.sh b/plugins/php/versions/73/install.sh index 968faf15d..140631184 100755 --- a/plugins/php/versions/73/install.sh +++ b/plugins/php/versions/73/install.sh @@ -12,6 +12,7 @@ install_tmp=${rootPath}/tmp/mw_install.pl version=7.3.12 +PHP_VER=73 Install_php() { #------------------------ install start ------------------------------------# @@ -19,15 +20,12 @@ echo "安装php-${version} ..." > $install_tmp mkdir -p $sourcePath/php mkdir -p $serverPath/php -if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then +if [ ! -f $sourcePath/php/${PHP_VER} ];then wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz http://au1.php.net/distributions/php-${version}.tar.xz -fi - -if [ ! -d $sourcePath/php/php-${version} ];then cd $sourcePath/php && tar -Jxf $sourcePath/php/php-${version}.tar.xz + mv $sourcePath/php/php-${version} $sourcePath/php/${PHP_VER} fi - OPTIONS='' if [ $sysName == 'Darwin' ]; then OPTIONS='--without-iconv' @@ -44,7 +42,7 @@ fi if [ ! -d $serverPath/php/73 ];then - cd $sourcePath/php/php-${version} && ./configure \ + cd $sourcePath/php/${PHP_VER} && ./configure \ --prefix=$serverPath/php/73 \ --exec-prefix=$serverPath/php/73 \ --with-config-file-path=$serverPath/php/73/etc \ @@ -57,7 +55,6 @@ if [ ! -d $serverPath/php/73 ];then --enable-sockets \ --enable-simplexml \ --enable-intl \ - --enable-wddx \ --enable-soap \ --enable-posix \ --enable-sysvmsg \ diff --git a/plugins/php/versions/74/install.sh b/plugins/php/versions/74/install.sh index 56fc70d03..d3d200d60 100755 --- a/plugins/php/versions/74/install.sh +++ b/plugins/php/versions/74/install.sh @@ -19,12 +19,14 @@ echo "安装php-${version} ..." > $install_tmp mkdir -p $sourcePath/php mkdir -p $serverPath/php -if [ ! -d $sourcePath/php/php-src-php-${version} ];then +if [ ! -d $sourcePath/php/php74 ];then wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.gz https://github.com/php/php-src/archive/php-${version}.tar.gz cd $sourcePath/php && tar zxvf $sourcePath/php/php-${version}.tar.gz + + mv $sourcePath/php/php-src-php-${version} $sourcePath/php/php74 fi -cd $sourcePath/php/php-src-php-${version} +cd $sourcePath/php/php74 OPTIONS='' if [ $sysName == 'Darwin' ]; then @@ -48,7 +50,7 @@ fi echo "$sourcePath/php/php-src-php-${version}" if [ ! -d $serverPath/php/74 ];then - cd $sourcePath/php/php-src-php-${version} + cd $sourcePath/php/php74 ./buildconf --force ./configure \ --prefix=$serverPath/php/74 \ diff --git a/plugins/php/versions/74/pcntl.sh b/plugins/php/versions/74/pcntl.sh new file mode 100755 index 000000000..fd7e64857 --- /dev/null +++ b/plugins/php/versions/74/pcntl.sh @@ -0,0 +1,79 @@ +#!/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 + +actionType=$1 +version=$2 + +LIBNAME=pcntl +LIBV=0 + +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190902/${LIBNAME}.so + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + + cd $sourcePath/php74/ext/${LIBNAME} + + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config + make clean && make && make install && make clean + + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "extension=${LIBNAME}.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 + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/${LIBNAME}/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/phplib.conf b/plugins/php/versions/phplib.conf index 8790c1936..d8580e433 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -48,6 +48,16 @@ "shell": "opcache.sh", "check": "opcache.so" }, + { + "name": "pcntl", + "versions": [ + "74" + ], + "type": "缓存器", + "msg": "用于加速PHP脚本!", + "shell": "pcntl.sh", + "check": "pcntl.so" + }, { "name": "intl", "versions": [