From 8879cba15d74dd26b3d64b8c0c4381e6c701e18e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 01:17:39 +0800 Subject: [PATCH 01/33] Update install.sh --- plugins/mysql-community/install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/mysql-community/install.sh b/plugins/mysql-community/install.sh index 35e594f48..7d8d80fd1 100755 --- a/plugins/mysql-community/install.sh +++ b/plugins/mysql-community/install.sh @@ -10,14 +10,15 @@ serverPath=$(dirname "$rootPath") # https://dev.mysql.com/downloads/mysql/ # https://downloads.mysql.com/archives/community/ +# SHOW VARIABLES LIKE 'default_authentication_plugin'; # /www/server/mysql-community/bin/mysqld --basedir=/www/server/mysql-community --datadir=/www/server/mysql-community/data --initialize-insecure --explicit_defaults_for_timestamp -# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh install 8.0 -# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh uninstall 8.0 -# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-community/index.py start 5.7 -# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-community/index.py fix_db_access +# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh install 9.0 +# cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh uninstall 9.0 +# cd /www/server/mdserver-web && python3 plugins/mysql-community/index.py start 8.0 +# cd /www/server/mdserver-web && python3 plugins/mysql-community/index.py fix_db_access # cd /www/server/mdserver-web && source bin/activate && python3 plugins/mysql/index.py do_full_sync {"db":"xxx","sign":"","begin":1} action=$1 From 24746dab083df81214f3527cbed73ec3b25a20b5 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 01:37:10 +0800 Subject: [PATCH 02/33] update --- plugins/mysql-community/conf/my8.0.cnf | 4 +++- plugins/mysql-community/index.py | 5 +++++ plugins/mysql-community/install.sh | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/mysql-community/conf/my8.0.cnf b/plugins/mysql-community/conf/my8.0.cnf index 388b397eb..6ed278882 100644 --- a/plugins/mysql-community/conf/my8.0.cnf +++ b/plugins/mysql-community/conf/my8.0.cnf @@ -8,7 +8,9 @@ default-character-set = UTF8MB4 [mysqld] !include {$SERVER_APP_PATH}/etc/mode/classic.cnf -authentication_policy=mysql_native_password +#authentication_policy=mysql_native_password +default-authentication-plugin=mysql_native_password + pid-file = {$SERVER_APP_PATH}/data/mysql.pid user = mysql port = 33206 diff --git a/plugins/mysql-community/index.py b/plugins/mysql-community/index.py index b9283a12d..eded6c1be 100755 --- a/plugins/mysql-community/index.py +++ b/plugins/mysql-community/index.py @@ -130,6 +130,11 @@ def getAuthPolicy(): tmp = re.search(rep, content) if tmp: return tmp.groups()[0].strip() + + rep2 = r'default-authentication-plugin\s*=\s*(.*)' + tmp2 = re.search(rep, content) + if tmp2: + return tmp2.groups()[0].strip() # caching_sha2_password return 'mysql_native_password' diff --git a/plugins/mysql-community/install.sh b/plugins/mysql-community/install.sh index 7d8d80fd1..42bf1dd51 100755 --- a/plugins/mysql-community/install.sh +++ b/plugins/mysql-community/install.sh @@ -11,6 +11,7 @@ serverPath=$(dirname "$rootPath") # https://downloads.mysql.com/archives/community/ # SHOW VARIABLES LIKE 'default_authentication_plugin'; +# SELECT user, host, plugin FROM mysql.user; # /www/server/mysql-community/bin/mysqld --basedir=/www/server/mysql-community --datadir=/www/server/mysql-community/data --initialize-insecure --explicit_defaults_for_timestamp From 9360a9cd68f0a62a9e8f99c810efb99e72d6af2d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 01:48:01 +0800 Subject: [PATCH 03/33] Update my8.0.cnf --- plugins/mysql-community/conf/my8.0.cnf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/mysql-community/conf/my8.0.cnf b/plugins/mysql-community/conf/my8.0.cnf index 6ed278882..2253e3a9c 100644 --- a/plugins/mysql-community/conf/my8.0.cnf +++ b/plugins/mysql-community/conf/my8.0.cnf @@ -8,8 +8,7 @@ default-character-set = UTF8MB4 [mysqld] !include {$SERVER_APP_PATH}/etc/mode/classic.cnf -#authentication_policy=mysql_native_password -default-authentication-plugin=mysql_native_password +authentication_policy=mysql_native_password pid-file = {$SERVER_APP_PATH}/data/mysql.pid user = mysql From 4122c113721048932edd64906491baf9f56391d6 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 02:02:24 +0800 Subject: [PATCH 04/33] Update my8.0.cnf --- plugins/mysql-community/conf/my8.0.cnf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql-community/conf/my8.0.cnf b/plugins/mysql-community/conf/my8.0.cnf index 2253e3a9c..02c484b44 100644 --- a/plugins/mysql-community/conf/my8.0.cnf +++ b/plugins/mysql-community/conf/my8.0.cnf @@ -8,7 +8,7 @@ default-character-set = UTF8MB4 [mysqld] !include {$SERVER_APP_PATH}/etc/mode/classic.cnf -authentication_policy=mysql_native_password +authentication_policy=caching_sha2_password pid-file = {$SERVER_APP_PATH}/data/mysql.pid user = mysql From 3dd14307d0e45a203abec6a5f77a35a5bf04aeec Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 02:25:30 +0800 Subject: [PATCH 05/33] Update install.sh --- plugins/php/versions/74/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/php/versions/74/install.sh b/plugins/php/versions/74/install.sh index 2520d135f..ada8102c2 100755 --- a/plugins/php/versions/74/install.sh +++ b/plugins/php/versions/74/install.sh @@ -115,6 +115,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --exec-prefix=$serverPath/php/${PHP_VER} \ --with-config-file-path=$serverPath/php/${PHP_VER}/etc \ --enable-mysqlnd \ + --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --enable-ftp \ From 08a41f039b11b2a3fc71aaf18d8d50f30e733bbf Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 02:27:18 +0800 Subject: [PATCH 06/33] Update install.sh --- plugins/php/versions/84/install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/php/versions/84/install.sh b/plugins/php/versions/84/install.sh index 715a227aa..ada71caf5 100755 --- a/plugins/php/versions/84/install.sh +++ b/plugins/php/versions/84/install.sh @@ -104,8 +104,10 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --exec-prefix=$serverPath/php/${PHP_VER} \ --with-config-file-path=$serverPath/php/${PHP_VER}/etc \ --enable-mysqlnd \ + --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ + --with-mysqlnd-ssl \ --enable-mbstring \ --enable-ftp \ --enable-sockets \ From 809c9ea237b1b50ba55842650826beeda2a56ad7 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 02:37:28 +0800 Subject: [PATCH 07/33] update --- plugins/php-apt/index_php_apt.py | 3 +- plugins/php-yum/index_php_yum.py | 2 +- plugins/php/index_php.py | 5 +- plugins/php/info.json | 2 +- plugins/php/versions/common/mysql_xdevapi.sh | 110 +++++++++++++++++++++++++++ plugins/php/versions/phplib.conf | 12 +++ 6 files changed, 127 insertions(+), 7 deletions(-) create mode 100755 plugins/php/versions/common/mysql_xdevapi.sh diff --git a/plugins/php-apt/index_php_apt.py b/plugins/php-apt/index_php_apt.py index c6b4301b0..15eaed2b6 100755 --- a/plugins/php-apt/index_php_apt.py +++ b/plugins/php-apt/index_php_apt.py @@ -140,8 +140,7 @@ def libConfCommon(version): phplib = json.loads(mw.readFile(libpath)) libs = [] - tasks = mw.M('tasks').where( - "status!=?", ('1',)).field('status,name').select() + tasks = mw.M('tasks').where("status!=?", ('1',)).field('status,name').select() for lib in phplib: lib['task'] = '1' for task in tasks: diff --git a/plugins/php-yum/index_php_yum.py b/plugins/php-yum/index_php_yum.py index 17bae712b..07f623974 100755 --- a/plugins/php-yum/index_php_yum.py +++ b/plugins/php-yum/index_php_yum.py @@ -54,7 +54,7 @@ def getFpmConfFile(version): def getPhpSocket(version): path = getFpmConfFile(version) content = mw.readFile(path) - rep = 'listen\s*=\s*(.*)' + rep = r'listen\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() diff --git a/plugins/php/index_php.py b/plugins/php/index_php.py index 06a90a9c4..688c42e50 100755 --- a/plugins/php/index_php.py +++ b/plugins/php/index_php.py @@ -64,7 +64,7 @@ def status_progress(version): def getPhpSocket(version): path = getFpmConfFile(version) content = mw.readFile(path) - rep = 'listen\s*=\s*(.*)' + rep = r'listen\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() @@ -133,8 +133,7 @@ def libConfCommon(version): phplib = json.loads(mw.readFile(libpath)) libs = [] - tasks = mw.M('tasks').where( - "status!=?", ('1',)).field('status,name').select() + tasks = mw.M('tasks').where("status!=?", ('1',)).field('status,name').select() for lib in phplib: lib['task'] = '1' for task in tasks: diff --git a/plugins/php/info.json b/plugins/php/info.json index a70da2433..190affe28 100755 --- a/plugins/php/info.json +++ b/plugins/php/info.json @@ -6,7 +6,7 @@ "title": "PHP", "coexist": true, "versions": ["53","54","55","56","70","71","72","73","74","80","81","82","83","84"], - "updates": ["5.3.29","5.4.45","5.6.36","7.0.30","7.1.33","7.2.32","7.3.20","7.4.30","8.0.30","8.1.29","8.2.24","8.3.12","8.4.0"], + "updates": ["5.3.29","5.4.45","5.6.36","7.0.30","7.1.33","7.2.32","7.3.20","7.4.30","8.0.30","8.1.29","8.2.27","8.3.15","8.4.2"], "tip": "soft", "install_pre_inspection":true, "checks": "server/php/VERSION/bin/php", diff --git a/plugins/php/versions/common/mysql_xdevapi.sh b/plugins/php/versions/common/mysql_xdevapi.sh new file mode 100755 index 000000000..4905f78a1 --- /dev/null +++ b/plugins/php/versions/common/mysql_xdevapi.sh @@ -0,0 +1,110 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH=$PATH:/opt/homebrew/bin + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php +SYS_ARCH=`arch` +LIBNAME=mysql_xdevapi +LIBV=8.0.30 +sysName=`uname` +actionType=$1 +version=$2 + + +LIB_PATH_NAME=lib/php +if [ -d $serverPath/php/${version}/lib64 ];then + LIB_PATH_NAME=lib64 +fi + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/${LIB_PATH_NAME}/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/${LIB_PATH_NAME}/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + +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 + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -d $php_lib/${LIBNAME}-${LIBV} ];then + if [ ! -f $php_lib/${LIBNAME}-${LIBV}.tgz ];then + wget --no-check-certificate -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz + fi + cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz + fi + cd $php_lib/${LIBNAME}-${LIBV} + + OPTIONS="" + if [ "${SYS_ARCH}" == "aarch64" ] && [ "$version" -lt "56" ];then + OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" + fi + + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS + make clean && make && make install && make clean + + cd $php_lib && rm -rf $php_lib/${LIBNAME}-${LIBV} + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + cd ${curPath} && bash ${rootPath}/plugins/php/versions/lib.sh $version restart + 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},请选择其它版本!" + echo "php-$version not install ${LIBNAME}, Plese select other version!" + return + fi + + 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 + cd ${curPath} && bash ${rootPath}/plugins/php/versions/lib.sh $version restart + 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 f81be4da5..9ebf254e6 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -187,6 +187,18 @@ "check": "mcrypt.so" }, { + "name": "mysql_xdevapi", + "versions": [ + "71", + "72", + "73" + ], + "type": "通用扩展", + "msg": "PHP71-73连接MySQL", + "shell": "mysql_xdevapi.sh", + "check": "mysql_xdevapi.so" + }, + { "name": "bcmath", "versions": [ "53", From 38e1c07e0b24d7f31b74fc1e9951afbdaa15f184 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 02:50:14 +0800 Subject: [PATCH 08/33] Update install.sh --- plugins/mysql-community/install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/mysql-community/install.sh b/plugins/mysql-community/install.sh index 42bf1dd51..4689daac5 100755 --- a/plugins/mysql-community/install.sh +++ b/plugins/mysql-community/install.sh @@ -12,15 +12,16 @@ serverPath=$(dirname "$rootPath") # SHOW VARIABLES LIKE 'default_authentication_plugin'; # SELECT user, host, plugin FROM mysql.user; +# default_authentication_plugin=caching_sha2_password # /www/server/mysql-community/bin/mysqld --basedir=/www/server/mysql-community --datadir=/www/server/mysql-community/data --initialize-insecure --explicit_defaults_for_timestamp - +# source bin/activate # cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh install 9.0 # cd /www/server/mdserver-web/plugins/mysql-community && bash install.sh uninstall 9.0 # cd /www/server/mdserver-web && python3 plugins/mysql-community/index.py start 8.0 # cd /www/server/mdserver-web && python3 plugins/mysql-community/index.py fix_db_access -# cd /www/server/mdserver-web && source bin/activate && python3 plugins/mysql/index.py do_full_sync {"db":"xxx","sign":"","begin":1} +# cd /www/server/mdserver-web && python3 plugins/mysql/index.py do_full_sync {"db":"xxx","sign":"","begin":1} action=$1 type=$2 From e5d312dbf9f0d2be53d3e06c8a99bc1093be3c96 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 03:19:49 +0800 Subject: [PATCH 09/33] Update install.sh --- plugins/php/versions/83/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/php/versions/83/install.sh b/plugins/php/versions/83/install.sh index 79f06f552..6ad2c4cc6 100755 --- a/plugins/php/versions/83/install.sh +++ b/plugins/php/versions/83/install.sh @@ -111,6 +111,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --exec-prefix=$serverPath/php/${PHP_VER} \ --with-config-file-path=$serverPath/php/${PHP_VER}/etc \ --enable-mysqlnd \ + --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --enable-mbstring \ From 5efa218247bd0cbd9e1147fb2445c2fe4ac3e58e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 03:20:18 +0800 Subject: [PATCH 10/33] Update install.sh --- plugins/php/versions/82/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/php/versions/82/install.sh b/plugins/php/versions/82/install.sh index 3170c203c..38574027a 100755 --- a/plugins/php/versions/82/install.sh +++ b/plugins/php/versions/82/install.sh @@ -110,6 +110,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --exec-prefix=$serverPath/php/${PHP_VER} \ --with-config-file-path=$serverPath/php/${PHP_VER}/etc \ --enable-mysqlnd \ + --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --enable-mbstring \ From 3b5585193fd6c700bba4d61ff8e23cd0efa7d964 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 03:22:56 +0800 Subject: [PATCH 11/33] update --- plugins/php/versions/80/install.sh | 1 + plugins/php/versions/81/install.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/php/versions/80/install.sh b/plugins/php/versions/80/install.sh index 9550c8bfa..ffeb20435 100755 --- a/plugins/php/versions/80/install.sh +++ b/plugins/php/versions/80/install.sh @@ -116,6 +116,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --exec-prefix=$serverPath/php/${PHP_VER} \ --with-config-file-path=$serverPath/php/${PHP_VER}/etc \ --enable-mysqlnd \ + --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --enable-ftp \ diff --git a/plugins/php/versions/81/install.sh b/plugins/php/versions/81/install.sh index 72714ac12..cecf387ed 100755 --- a/plugins/php/versions/81/install.sh +++ b/plugins/php/versions/81/install.sh @@ -108,6 +108,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --exec-prefix=$serverPath/php/${PHP_VER} \ --with-config-file-path=$serverPath/php/${PHP_VER}/etc \ --enable-mysqlnd \ + --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --enable-ftp \ From d6347f6d4af8375557f3fa717dd8bcf2c041f9ab Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 03:24:04 +0800 Subject: [PATCH 12/33] update --- 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 | 1 + 4 files changed, 4 insertions(+) diff --git a/plugins/php/versions/70/install.sh b/plugins/php/versions/70/install.sh index 2225bc953..9a1fa2302 100755 --- a/plugins/php/versions/70/install.sh +++ b/plugins/php/versions/70/install.sh @@ -109,6 +109,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --exec-prefix=$serverPath/php/${PHP_VER} \ --with-config-file-path=$serverPath/php/${PHP_VER}/etc \ --enable-mysqlnd \ + --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --enable-mbstring \ diff --git a/plugins/php/versions/71/install.sh b/plugins/php/versions/71/install.sh index 9a1983fa9..cec5b593e 100755 --- a/plugins/php/versions/71/install.sh +++ b/plugins/php/versions/71/install.sh @@ -111,6 +111,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --exec-prefix=$serverPath/php/${PHP_VER} \ --with-config-file-path=$serverPath/php/${PHP_VER}/etc \ --enable-mysqlnd \ + --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --enable-mbstring \ diff --git a/plugins/php/versions/72/install.sh b/plugins/php/versions/72/install.sh index dbddba573..df8946385 100755 --- a/plugins/php/versions/72/install.sh +++ b/plugins/php/versions/72/install.sh @@ -107,6 +107,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --exec-prefix=$serverPath/php/${PHP_VER} \ --with-config-file-path=$serverPath/php/${PHP_VER}/etc \ --enable-mysqlnd \ + --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --enable-mbstring \ diff --git a/plugins/php/versions/73/install.sh b/plugins/php/versions/73/install.sh index eef39686d..c986db00a 100755 --- a/plugins/php/versions/73/install.sh +++ b/plugins/php/versions/73/install.sh @@ -111,6 +111,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --exec-prefix=$serverPath/php/${PHP_VER} \ --with-config-file-path=$serverPath/php/${PHP_VER}/etc \ --enable-mysqlnd \ + --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --enable-ftp \ From 7399cd7d45514409280ef01a3bcee6105adbce26 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 03:39:54 +0800 Subject: [PATCH 13/33] Update install.sh --- plugins/php/versions/83/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/php/versions/83/install.sh b/plugins/php/versions/83/install.sh index 6ad2c4cc6..54fdfe668 100755 --- a/plugins/php/versions/83/install.sh +++ b/plugins/php/versions/83/install.sh @@ -114,6 +114,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ + --with-openssl \ --enable-mbstring \ --enable-ftp \ --enable-sockets \ From 792b1348c1af175f8e2e2a45d6eb36237823974e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 04:06:12 +0800 Subject: [PATCH 14/33] Update openssl.sh --- plugins/php/versions/common/openssl.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/php/versions/common/openssl.sh b/plugins/php/versions/common/openssl.sh index 60f447db6..007e68cb1 100755 --- a/plugins/php/versions/common/openssl.sh +++ b/plugins/php/versions/common/openssl.sh @@ -114,26 +114,26 @@ Install_lib() # fi - $serverPath/php/$version/bin/phpize + # $serverPath/php/$version/bin/phpize # --with-openssl - echo "./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS" - ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS - make clean && make && make install && make clean + # echo "./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS" + # ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS + # make clean && make && make install && make clean - if [ -d $sourcePath/php${version} ];then - cd ${sourcePath} && rm -rf $sourcePath/php${version} - fi + # if [ -d $sourcePath/php${version} ];then + # cd ${sourcePath} && rm -rf $sourcePath/php${version} + # fi fi - if [ ! -f "$extFile" ];then - echo "ERROR!" - return - fi + # if [ ! -f "$extFile" ];then + # echo "ERROR!" + # return + # 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 + # echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini if [ -f "/etc/ssl/certs/ca-certificates.crt" ];then echo "openssl.cafile=/etc/ssl/certs/ca-certificates.crt" >> $serverPath/php/$version/etc/php.ini elif [ -f "/etc/pki/tls/certs/ca-bundle.crt" ];then From 3bef89d625236d621be5ca7e0b73ec4a9608207b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 04:39:37 +0800 Subject: [PATCH 15/33] update --- plugins/php/versions/52/install.sh | 12 ++ plugins/php/versions/53/install.sh | 13 +++ plugins/php/versions/54/install.sh | 13 +++ plugins/php/versions/55/install.sh | 13 +++ plugins/php/versions/56/install.sh | 12 ++ plugins/php/versions/70/install.sh | 13 +++ plugins/php/versions/71/install.sh | 13 +++ plugins/php/versions/72/install.sh | 13 +++ plugins/php/versions/73/install.sh | 13 +++ plugins/php/versions/74/install.sh | 13 +++ plugins/php/versions/80/install.sh | 13 +++ plugins/php/versions/81/install.sh | 13 +++ plugins/php/versions/82/install.sh | 13 +++ plugins/php/versions/83/install.sh | 15 ++- plugins/php/versions/84/install.sh | 13 +++ plugins/php/versions/common/openssl.sh | 97 ---------------- plugins/php/versions/common/openssl_bak.sh | 177 +++++++++++++++++++++++++++++ 17 files changed, 370 insertions(+), 99 deletions(-) create mode 100755 plugins/php/versions/common/openssl_bak.sh diff --git a/plugins/php/versions/52/install.sh b/plugins/php/versions/52/install.sh index 7516e0f04..538e8dc0c 100755 --- a/plugins/php/versions/52/install.sh +++ b/plugins/php/versions/52/install.sh @@ -96,6 +96,18 @@ if [ "${SYS_ARCH}" == "aarch64" ];then OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" fi +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi if [ ! -d $serverPath/php/${PHP_VER} ];then diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh index 49906af25..a4f06df7f 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -104,6 +104,19 @@ if [ "${SYS_ARCH}" == "aarch64" ];then OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" fi +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + if [ ! -d $serverPath/php/${PHP_VER}/bin ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/${PHP_VER} \ diff --git a/plugins/php/versions/54/install.sh b/plugins/php/versions/54/install.sh index 5c0012883..07fb4f296 100755 --- a/plugins/php/versions/54/install.sh +++ b/plugins/php/versions/54/install.sh @@ -107,6 +107,19 @@ if [ "${SYS_ARCH}" == "arm64" ] && [ "$sysName" == "Darwin" ] ;then cat ${curPath}/versions/${PHP_VER}/src/reentrancy.c > $sourcePath/php/php${PHP_VER}/main/reentrancy.c fi +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/${PHP_VER} \ diff --git a/plugins/php/versions/55/install.sh b/plugins/php/versions/55/install.sh index 4331d545e..eec0ab28f 100755 --- a/plugins/php/versions/55/install.sh +++ b/plugins/php/versions/55/install.sh @@ -107,6 +107,19 @@ if [ "${SYS_ARCH}" == "arm64" ] && [ "$sysName" == "Darwin" ] ;then cat ${curPath}/versions/${PHP_VER}/src/reentrancy.c > $sourcePath/php/php${PHP_VER}/main/reentrancy.c fi +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/${PHP_VER} \ diff --git a/plugins/php/versions/56/install.sh b/plugins/php/versions/56/install.sh index 85259ac0b..724096c15 100755 --- a/plugins/php/versions/56/install.sh +++ b/plugins/php/versions/56/install.sh @@ -115,6 +115,18 @@ if [ "${SYS_ARCH}" == "arm64" ] && [ "$sysName" == "Darwin" ] ;then cat ${curPath}/versions/${PHP_VER}/src/mkstemp.c > $sourcePath/php/php${PHP_VER}/ext/zip/lib/mkstemp.c fi +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ diff --git a/plugins/php/versions/70/install.sh b/plugins/php/versions/70/install.sh index 9a1fa2302..1b28abc63 100755 --- a/plugins/php/versions/70/install.sh +++ b/plugins/php/versions/70/install.sh @@ -103,6 +103,19 @@ if [ "${SYS_ARCH}" == "arm64" ] && [ "$sysName" == "Darwin" ] ;then cat ${curPath}/versions/${PHP_VER}/src/mkstemp.c > $sourcePath/php/php${PHP_VER}/ext/zip/lib/mkstemp.c fi +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/${PHP_VER} \ diff --git a/plugins/php/versions/71/install.sh b/plugins/php/versions/71/install.sh index cec5b593e..376783b52 100755 --- a/plugins/php/versions/71/install.sh +++ b/plugins/php/versions/71/install.sh @@ -105,6 +105,19 @@ if [ "${SYS_ARCH}" == "arm64" ] && [ "$sysName" == "Darwin" ] ;then cat ${curPath}/versions/${PHP_VER}/src/mkstemp.c > $sourcePath/php/php${PHP_VER}/ext/zip/lib/mkstemp.c fi +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/${PHP_VER} \ diff --git a/plugins/php/versions/72/install.sh b/plugins/php/versions/72/install.sh index df8946385..83fd54b15 100755 --- a/plugins/php/versions/72/install.sh +++ b/plugins/php/versions/72/install.sh @@ -101,6 +101,19 @@ if [ "${SYS_ARCH}" == "arm64" ];then echo "cat ${curPath}/versions/${PHP_VER}/src/reentrancy.c > $sourcePath/php/php${PHP_VER}/main/reentrancy.c" fi +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/${PHP_VER} \ diff --git a/plugins/php/versions/73/install.sh b/plugins/php/versions/73/install.sh index c986db00a..f468b6c65 100755 --- a/plugins/php/versions/73/install.sh +++ b/plugins/php/versions/73/install.sh @@ -105,6 +105,19 @@ else fi # ----- cpu end ------ +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} ./configure --prefix=$serverPath/php/${PHP_VER} \ diff --git a/plugins/php/versions/74/install.sh b/plugins/php/versions/74/install.sh index ada8102c2..7ff0234a4 100755 --- a/plugins/php/versions/74/install.sh +++ b/plugins/php/versions/74/install.sh @@ -108,6 +108,19 @@ else fi # ----- cpu end ------ +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} && make clean ./configure \ diff --git a/plugins/php/versions/80/install.sh b/plugins/php/versions/80/install.sh index ffeb20435..581613c9d 100755 --- a/plugins/php/versions/80/install.sh +++ b/plugins/php/versions/80/install.sh @@ -108,6 +108,19 @@ fi # echo "$sourcePath/php/php${PHP_VER}" +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} ./buildconf --force diff --git a/plugins/php/versions/81/install.sh b/plugins/php/versions/81/install.sh index cecf387ed..8e985772f 100755 --- a/plugins/php/versions/81/install.sh +++ b/plugins/php/versions/81/install.sh @@ -101,6 +101,19 @@ fi echo "$sourcePath/php/php${PHP_VER}" +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} ./configure \ diff --git a/plugins/php/versions/82/install.sh b/plugins/php/versions/82/install.sh index 38574027a..4a7198739 100755 --- a/plugins/php/versions/82/install.sh +++ b/plugins/php/versions/82/install.sh @@ -102,6 +102,19 @@ else fi # ----- cpu end ------ +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + # echo "$sourcePath/php/php${PHP_VER}" if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} diff --git a/plugins/php/versions/83/install.sh b/plugins/php/versions/83/install.sh index 54fdfe668..c40bd6121 100755 --- a/plugins/php/versions/83/install.sh +++ b/plugins/php/versions/83/install.sh @@ -102,8 +102,20 @@ else fi # ----- cpu end ------ -echo "$sourcePath/php/php${PHP_VER}" +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + +# echo "$sourcePath/php/php${PHP_VER}" if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} ./configure \ @@ -114,7 +126,6 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ - --with-openssl \ --enable-mbstring \ --enable-ftp \ --enable-sockets \ diff --git a/plugins/php/versions/84/install.sh b/plugins/php/versions/84/install.sh index ada71caf5..f5ec7b389 100755 --- a/plugins/php/versions/84/install.sh +++ b/plugins/php/versions/84/install.sh @@ -94,6 +94,19 @@ fi # OPTIONS="${OPTIONS} --enable-debug" # OPTIONS="${OPTIONS} --enable-dtrace" +if [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" +else + OPTIONS="$OPTIONS --with-openssl" +fi + echo "$sourcePath/php/php${PHP_VER}" if [ ! -d $serverPath/php/${PHP_VER} ];then diff --git a/plugins/php/versions/common/openssl.sh b/plugins/php/versions/common/openssl.sh index 007e68cb1..efe9c85e4 100755 --- a/plugins/php/versions/common/openssl.sh +++ b/plugins/php/versions/common/openssl.sh @@ -35,105 +35,8 @@ fi Install_lib() { - isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` - if [ "${isInstall}" != "" ];then - echo "php-$version 已安装${LIBNAME},请选择其它版本!" - return - fi - - # cd ${rootPath}/plugins/php/lib && /bin/bash openssl_10.sh - if [ "$version" -lt "81" ];then - cd ${rootPath}/plugins/php/lib && /bin/bash openssl_10.sh - fi - - if [ "$version" -gt "82" ];then - cd ${rootPath}/plugins/php/lib && /bin/bash openssl.sh - fi - - if [ "$sysName" == "Darwin" ] ;then - BREW_DIR=`which brew` - BREW_DIR=${BREW_DIR/\/bin\/brew/} - - LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig - fi - - if [ ! -f "$extFile" ];then - - if [ ! -d $sourcePath/php${version}/ext ];then - cd ${rootPath}/plugins/php && /bin/bash ${rootPath}/plugins/php/versions/${version}/install.sh install - fi - - cd $sourcePath/php${version}/ext/${LIBNAME} - - if [ ! -f "config.m4" ];then - mv config0.m4 config.m4 - fi - - OPTIONS="" - if [ "${SYS_ARCH}" == "aarch64" ] && [ "$version" -lt "56" ];then - OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" - fi - - # openssl_version=`pkg-config openssl --modversion` - # export PKG_CONFIG_PATH=$serverPath/lib/openssl10/lib/pkgconfig - if [ "$version" -lt "81" ] && [ "$sysName" != "Darwin" ];then - export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$serverPath/lib/openssl10/lib/pkgconfig - fi - - # Darwin - # otool -L /Users/midoks/Desktop/mwdev/server/php/83/bin/php - # lldb /Users/midoks/Desktop/mwdev/server/php/83/bin/php -r 'phpinfo()' - # otool -L /Users/midoks/Desktop/mwdev/server/php/83/lib/php/extensions/no-debug-non-zts-20230831/openssl.so - # ldd /www/server/php/83/bin/php - - if [ "$version" -lt "84" ] && [ "$sysName" == "Darwin" ];then - BREW_DIR=`which brew` - BREW_DIR=${BREW_DIR/\/bin\/brew/} - LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl@1.0 | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl@1.0)" - export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig - export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" - export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" - - echo "$LIB_DEPEND_DIR/lib/pkgconfig" - fi - - if [ "$version" -ge "84" ] && [ "$sysName" == "Darwin" ];then - BREW_DIR=`which brew` - BREW_DIR=${BREW_DIR/\/bin\/brew/} - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" - export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig - export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" - export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" - fi - - # if [ "$version" -gt "82" ] && [ "$sysName" == "Darwin" ];then - # export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig - # fi - - - # $serverPath/php/$version/bin/phpize - # --with-openssl - # echo "./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS" - # ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS - # make clean && make && make install && make clean - - # if [ -d $sourcePath/php${version} ];then - # cd ${sourcePath} && rm -rf $sourcePath/php${version} - # fi - - fi - - # if [ ! -f "$extFile" ];then - # echo "ERROR!" - # return - # 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 if [ -f "/etc/ssl/certs/ca-certificates.crt" ];then echo "openssl.cafile=/etc/ssl/certs/ca-certificates.crt" >> $serverPath/php/$version/etc/php.ini elif [ -f "/etc/pki/tls/certs/ca-bundle.crt" ];then diff --git a/plugins/php/versions/common/openssl_bak.sh b/plugins/php/versions/common/openssl_bak.sh new file mode 100755 index 000000000..b011245cb --- /dev/null +++ b/plugins/php/versions/common/openssl_bak.sh @@ -0,0 +1,177 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH=$PATH:/opt/homebrew/bin + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php +SYS_ARCH=`arch` +actionType=$1 +version=$2 + +LIBNAME=openssl +LIBV=0 + +LIB_PATH_NAME=lib/php +if [ -d $serverPath/php/${version}/lib64 ];then + LIB_PATH_NAME=lib64 +fi + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/${LIB_PATH_NAME}/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/${LIB_PATH_NAME}/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + +sysName=`uname` +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + # cd ${rootPath}/plugins/php/lib && /bin/bash openssl_10.sh + if [ "$version" -lt "81" ];then + cd ${rootPath}/plugins/php/lib && /bin/bash openssl_10.sh + fi + + if [ "$version" -gt "82" ];then + cd ${rootPath}/plugins/php/lib && /bin/bash openssl.sh + fi + + if [ "$sysName" == "Darwin" ] ;then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + fi + + if [ ! -f "$extFile" ];then + + if [ ! -d $sourcePath/php${version}/ext ];then + cd ${rootPath}/plugins/php && /bin/bash ${rootPath}/plugins/php/versions/${version}/install.sh install + fi + + cd $sourcePath/php${version}/ext/${LIBNAME} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + OPTIONS="" + if [ "${SYS_ARCH}" == "aarch64" ] && [ "$version" -lt "56" ];then + OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" + fi + + # openssl_version=`pkg-config openssl --modversion` + # export PKG_CONFIG_PATH=$serverPath/lib/openssl10/lib/pkgconfig + if [ "$version" -lt "81" ] && [ "$sysName" != "Darwin" ];then + export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$serverPath/lib/openssl10/lib/pkgconfig + fi + + # Darwin + # otool -L /Users/midoks/Desktop/mwdev/server/php/83/bin/php + # lldb /Users/midoks/Desktop/mwdev/server/php/83/bin/php -r 'phpinfo()' + # otool -L /Users/midoks/Desktop/mwdev/server/php/83/lib/php/extensions/no-debug-non-zts-20230831/openssl.so + # ldd /www/server/php/83/bin/php + + if [ "$version" -lt "84" ] && [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl@1.0 | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl@1.0)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" + + echo "$LIB_DEPEND_DIR/lib/pkgconfig" + fi + + if [ "$version" -ge "84" ] && [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" + fi + + # if [ "$version" -gt "82" ] && [ "$sysName" == "Darwin" ];then + # export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + # fi + + + $serverPath/php/$version/bin/phpize + # --with-openssl + echo "./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS" + ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS + make clean && make && make install && make clean + + if [ -d $sourcePath/php${version} ];then + cd ${sourcePath} && rm -rf $sourcePath/php${version} + fi + + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + 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 + if [ -f "/etc/ssl/certs/ca-certificates.crt" ];then + echo "openssl.cafile=/etc/ssl/certs/ca-certificates.crt" >> $serverPath/php/$version/etc/php.ini + elif [ -f "/etc/pki/tls/certs/ca-bundle.crt" ];then + echo "openssl.cafile=/etc/pki/tls/certs/ca-bundle.crt" >> $serverPath/php/$version/etc/php.ini + fi + + cd ${curPath} && bash ${rootPath}/plugins/php/versions/lib.sh $version restart + 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 + cd ${curPath} && bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file From bb72b53f19e347983bd7ff82b111a5c432892062 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 04:57:54 +0800 Subject: [PATCH 16/33] Update openssl.sh --- plugins/php/versions/common/openssl.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/php/versions/common/openssl.sh b/plugins/php/versions/common/openssl.sh index efe9c85e4..576f7d182 100755 --- a/plugins/php/versions/common/openssl.sh +++ b/plugins/php/versions/common/openssl.sh @@ -34,6 +34,15 @@ fi 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 + echo "locked" > $extFile + fi echo "" >> $serverPath/php/$version/etc/php.ini echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini From 11d245dadfce7931179c3dc99a4b1f0e8b5e138d Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 05:22:19 +0800 Subject: [PATCH 17/33] Update index_php.py --- plugins/php/index_php.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/plugins/php/index_php.py b/plugins/php/index_php.py index 688c42e50..e23f9490c 100755 --- a/plugins/php/index_php.py +++ b/plugins/php/index_php.py @@ -132,6 +132,14 @@ def libConfCommon(version): libpath = getPluginDir() + '/versions/phplib.conf' phplib = json.loads(mw.readFile(libpath)) + php_dir = getServerDir() + "/" + version + ext_dir = php_dir+"/lib/php/extensions" + + ext_list = os.listdir(ext_dir) + for sodir in ext_list: + if sodir.find("no-debug-non-zts") > -1: + ext_dir += "/"+ sodir + libs = [] tasks = mw.M('tasks').where("status!=?", ('1',)).field('status,name').select() for lib in phplib: @@ -145,10 +153,15 @@ def libConfCommon(version): lib['task'] = task['status'] lib['phpversions'] = [] lib['phpversions'].append(tmp1[1]) - if phpini.find(lib['check']) == -1: - lib['status'] = False - else: + + lib['status'] = False + if phpini.find(lib['check']) > -1: lib['status'] = True + sofile = ext_dir+"/"+lib['check'] + if os.path.exists(sofile): + # print(os.path.getsize(sofile)) + if os.path.getsize(sofile) == 7: + lib['status'] = True libs.append(lib) return libs From 4629d399808219faa0fa2c3964fcaecb5ce1adc8 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 05:23:14 +0800 Subject: [PATCH 18/33] Update index_php.py --- plugins/php/index_php.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/index_php.py b/plugins/php/index_php.py index e23f9490c..29010ce48 100755 --- a/plugins/php/index_php.py +++ b/plugins/php/index_php.py @@ -158,8 +158,8 @@ def libConfCommon(version): if phpini.find(lib['check']) > -1: lib['status'] = True sofile = ext_dir+"/"+lib['check'] + # 自定义,比较特殊的方式 if os.path.exists(sofile): - # print(os.path.getsize(sofile)) if os.path.getsize(sofile) == 7: lib['status'] = True libs.append(lib) From 9d467a13bb0501ce6ea8d0a8b818adfbd17ba8d1 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 05:33:40 +0800 Subject: [PATCH 19/33] Update index_php.py --- plugins/php/index_php.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/php/index_php.py b/plugins/php/index_php.py index 29010ce48..49edd6d0a 100755 --- a/plugins/php/index_php.py +++ b/plugins/php/index_php.py @@ -139,6 +139,7 @@ def libConfCommon(version): for sodir in ext_list: if sodir.find("no-debug-non-zts") > -1: ext_dir += "/"+ sodir + break libs = [] tasks = mw.M('tasks').where("status!=?", ('1',)).field('status,name').select() From b985d42336bd962e6297bd40d0b5b4338c33b53c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 11:48:08 +0800 Subject: [PATCH 20/33] update --- plugins/php/versions/70/install.sh | 4 ++-- plugins/php/versions/71/install.sh | 4 ++-- plugins/php/versions/72/install.sh | 4 ++-- plugins/php/versions/73/install.sh | 4 ++-- plugins/php/versions/74/install.sh | 4 ++-- plugins/php/versions/80/install.sh | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/php/versions/70/install.sh b/plugins/php/versions/70/install.sh index 1b28abc63..fb6df9fac 100755 --- a/plugins/php/versions/70/install.sh +++ b/plugins/php/versions/70/install.sh @@ -107,8 +107,8 @@ if [ "$sysName" == "Darwin" ];then BREW_DIR=`which brew` BREW_DIR=${BREW_DIR/\/bin\/brew/} - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl@1.0 | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl@1.0)" export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" diff --git a/plugins/php/versions/71/install.sh b/plugins/php/versions/71/install.sh index 376783b52..5037b4baf 100755 --- a/plugins/php/versions/71/install.sh +++ b/plugins/php/versions/71/install.sh @@ -109,8 +109,8 @@ if [ "$sysName" == "Darwin" ];then BREW_DIR=`which brew` BREW_DIR=${BREW_DIR/\/bin\/brew/} - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl@1.0 | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl@1.0)" export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" diff --git a/plugins/php/versions/72/install.sh b/plugins/php/versions/72/install.sh index 83fd54b15..0cdb32623 100755 --- a/plugins/php/versions/72/install.sh +++ b/plugins/php/versions/72/install.sh @@ -105,8 +105,8 @@ if [ "$sysName" == "Darwin" ];then BREW_DIR=`which brew` BREW_DIR=${BREW_DIR/\/bin\/brew/} - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl@1.0 | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl@1.0)" export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" diff --git a/plugins/php/versions/73/install.sh b/plugins/php/versions/73/install.sh index f468b6c65..26442d240 100755 --- a/plugins/php/versions/73/install.sh +++ b/plugins/php/versions/73/install.sh @@ -109,8 +109,8 @@ if [ "$sysName" == "Darwin" ];then BREW_DIR=`which brew` BREW_DIR=${BREW_DIR/\/bin\/brew/} - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl@1.0 | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl@1.0)" export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" diff --git a/plugins/php/versions/74/install.sh b/plugins/php/versions/74/install.sh index 7ff0234a4..550738326 100755 --- a/plugins/php/versions/74/install.sh +++ b/plugins/php/versions/74/install.sh @@ -112,8 +112,8 @@ if [ "$sysName" == "Darwin" ];then BREW_DIR=`which brew` BREW_DIR=${BREW_DIR/\/bin\/brew/} - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl@1.0 | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl@1.0)" export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" diff --git a/plugins/php/versions/80/install.sh b/plugins/php/versions/80/install.sh index 581613c9d..70422c6b4 100755 --- a/plugins/php/versions/80/install.sh +++ b/plugins/php/versions/80/install.sh @@ -112,8 +112,8 @@ if [ "$sysName" == "Darwin" ];then BREW_DIR=`which brew` BREW_DIR=${BREW_DIR/\/bin\/brew/} - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl@1.0 | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl@1.0)" export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" From b957595944394bc3f5aced12231c8adbf6f9f6ec Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 11:53:20 +0800 Subject: [PATCH 21/33] update --- plugins/php/versions/56/install.sh | 13 -- plugins/php/versions/common/openssl.sh | 6 + plugins/php/versions/common/openssl_low_version.sh | 177 +++++++++++++++++++++ 3 files changed, 183 insertions(+), 13 deletions(-) create mode 100755 plugins/php/versions/common/openssl_low_version.sh diff --git a/plugins/php/versions/56/install.sh b/plugins/php/versions/56/install.sh index 724096c15..a811da0f6 100755 --- a/plugins/php/versions/56/install.sh +++ b/plugins/php/versions/56/install.sh @@ -115,19 +115,6 @@ if [ "${SYS_ARCH}" == "arm64" ] && [ "$sysName" == "Darwin" ] ;then cat ${curPath}/versions/${PHP_VER}/src/mkstemp.c > $sourcePath/php/php${PHP_VER}/ext/zip/lib/mkstemp.c fi -if [ "$sysName" == "Darwin" ];then - BREW_DIR=`which brew` - BREW_DIR=${BREW_DIR/\/bin\/brew/} - - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" - export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig - export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" - export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" -else - OPTIONS="$OPTIONS --with-openssl" -fi - if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/${PHP_VER} \ diff --git a/plugins/php/versions/common/openssl.sh b/plugins/php/versions/common/openssl.sh index 576f7d182..d6583329f 100755 --- a/plugins/php/versions/common/openssl.sh +++ b/plugins/php/versions/common/openssl.sh @@ -34,6 +34,12 @@ fi Install_lib() { + if [ "$version" -lt "70" ];then + bash $curPath/openssl_low_version.sh $1 $2 + return + fi + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` if [ "${isInstall}" != "" ];then echo "php-$version 已安装${LIBNAME},请选择其它版本!" diff --git a/plugins/php/versions/common/openssl_low_version.sh b/plugins/php/versions/common/openssl_low_version.sh new file mode 100755 index 000000000..b011245cb --- /dev/null +++ b/plugins/php/versions/common/openssl_low_version.sh @@ -0,0 +1,177 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH=$PATH:/opt/homebrew/bin + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php +SYS_ARCH=`arch` +actionType=$1 +version=$2 + +LIBNAME=openssl +LIBV=0 + +LIB_PATH_NAME=lib/php +if [ -d $serverPath/php/${version}/lib64 ];then + LIB_PATH_NAME=lib64 +fi + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/${LIB_PATH_NAME}/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/${LIB_PATH_NAME}/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + +sysName=`uname` +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + # cd ${rootPath}/plugins/php/lib && /bin/bash openssl_10.sh + if [ "$version" -lt "81" ];then + cd ${rootPath}/plugins/php/lib && /bin/bash openssl_10.sh + fi + + if [ "$version" -gt "82" ];then + cd ${rootPath}/plugins/php/lib && /bin/bash openssl.sh + fi + + if [ "$sysName" == "Darwin" ] ;then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + + LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + fi + + if [ ! -f "$extFile" ];then + + if [ ! -d $sourcePath/php${version}/ext ];then + cd ${rootPath}/plugins/php && /bin/bash ${rootPath}/plugins/php/versions/${version}/install.sh install + fi + + cd $sourcePath/php${version}/ext/${LIBNAME} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + OPTIONS="" + if [ "${SYS_ARCH}" == "aarch64" ] && [ "$version" -lt "56" ];then + OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" + fi + + # openssl_version=`pkg-config openssl --modversion` + # export PKG_CONFIG_PATH=$serverPath/lib/openssl10/lib/pkgconfig + if [ "$version" -lt "81" ] && [ "$sysName" != "Darwin" ];then + export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$serverPath/lib/openssl10/lib/pkgconfig + fi + + # Darwin + # otool -L /Users/midoks/Desktop/mwdev/server/php/83/bin/php + # lldb /Users/midoks/Desktop/mwdev/server/php/83/bin/php -r 'phpinfo()' + # otool -L /Users/midoks/Desktop/mwdev/server/php/83/lib/php/extensions/no-debug-non-zts-20230831/openssl.so + # ldd /www/server/php/83/bin/php + + if [ "$version" -lt "84" ] && [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl@1.0 | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl@1.0)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" + + echo "$LIB_DEPEND_DIR/lib/pkgconfig" + fi + + if [ "$version" -ge "84" ] && [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" + fi + + # if [ "$version" -gt "82" ] && [ "$sysName" == "Darwin" ];then + # export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + # fi + + + $serverPath/php/$version/bin/phpize + # --with-openssl + echo "./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS" + ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS + make clean && make && make install && make clean + + if [ -d $sourcePath/php${version} ];then + cd ${sourcePath} && rm -rf $sourcePath/php${version} + fi + + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + 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 + if [ -f "/etc/ssl/certs/ca-certificates.crt" ];then + echo "openssl.cafile=/etc/ssl/certs/ca-certificates.crt" >> $serverPath/php/$version/etc/php.ini + elif [ -f "/etc/pki/tls/certs/ca-bundle.crt" ];then + echo "openssl.cafile=/etc/pki/tls/certs/ca-bundle.crt" >> $serverPath/php/$version/etc/php.ini + fi + + cd ${curPath} && bash ${rootPath}/plugins/php/versions/lib.sh $version restart + 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 + cd ${curPath} && bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file From a28733521b318bf71050e5a2a185daafd0cdc3e2 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 11:54:00 +0800 Subject: [PATCH 22/33] update --- plugins/php/versions/52/install.sh | 13 ------------- plugins/php/versions/53/install.sh | 13 ------------- plugins/php/versions/54/install.sh | 13 ------------- plugins/php/versions/55/install.sh | 13 ------------- 4 files changed, 52 deletions(-) diff --git a/plugins/php/versions/52/install.sh b/plugins/php/versions/52/install.sh index 538e8dc0c..3d9225a25 100755 --- a/plugins/php/versions/52/install.sh +++ b/plugins/php/versions/52/install.sh @@ -96,19 +96,6 @@ if [ "${SYS_ARCH}" == "aarch64" ];then OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" fi -if [ "$sysName" == "Darwin" ];then - BREW_DIR=`which brew` - BREW_DIR=${BREW_DIR/\/bin\/brew/} - - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" - export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig - export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" - export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" -else - OPTIONS="$OPTIONS --with-openssl" -fi - if [ ! -d $serverPath/php/${PHP_VER} ];then export MYSQL_LIB_DIR=/usr/lib64/mysql diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh index a4f06df7f..49906af25 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -104,19 +104,6 @@ if [ "${SYS_ARCH}" == "aarch64" ];then OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" fi -if [ "$sysName" == "Darwin" ];then - BREW_DIR=`which brew` - BREW_DIR=${BREW_DIR/\/bin\/brew/} - - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" - export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig - export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" - export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" -else - OPTIONS="$OPTIONS --with-openssl" -fi - if [ ! -d $serverPath/php/${PHP_VER}/bin ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/${PHP_VER} \ diff --git a/plugins/php/versions/54/install.sh b/plugins/php/versions/54/install.sh index 07fb4f296..5c0012883 100755 --- a/plugins/php/versions/54/install.sh +++ b/plugins/php/versions/54/install.sh @@ -107,19 +107,6 @@ if [ "${SYS_ARCH}" == "arm64" ] && [ "$sysName" == "Darwin" ] ;then cat ${curPath}/versions/${PHP_VER}/src/reentrancy.c > $sourcePath/php/php${PHP_VER}/main/reentrancy.c fi -if [ "$sysName" == "Darwin" ];then - BREW_DIR=`which brew` - BREW_DIR=${BREW_DIR/\/bin\/brew/} - - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" - export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig - export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" - export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" -else - OPTIONS="$OPTIONS --with-openssl" -fi - if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/${PHP_VER} \ diff --git a/plugins/php/versions/55/install.sh b/plugins/php/versions/55/install.sh index eec0ab28f..4331d545e 100755 --- a/plugins/php/versions/55/install.sh +++ b/plugins/php/versions/55/install.sh @@ -107,19 +107,6 @@ if [ "${SYS_ARCH}" == "arm64" ] && [ "$sysName" == "Darwin" ] ;then cat ${curPath}/versions/${PHP_VER}/src/reentrancy.c > $sourcePath/php/php${PHP_VER}/main/reentrancy.c fi -if [ "$sysName" == "Darwin" ];then - BREW_DIR=`which brew` - BREW_DIR=${BREW_DIR/\/bin\/brew/} - - LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` - OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl)" - export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig - export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" - export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" -else - OPTIONS="$OPTIONS --with-openssl" -fi - if [ ! -d $serverPath/php/${PHP_VER} ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/${PHP_VER} \ From d4c47c16e4bfaba8d4985ce2dc89f47af4cc4bab Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 11:56:03 +0800 Subject: [PATCH 23/33] Update all_test.sh --- plugins/php-apt/versions/all_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/php-apt/versions/all_test.sh b/plugins/php-apt/versions/all_test.sh index bd5b241d4..975893121 100644 --- a/plugins/php-apt/versions/all_test.sh +++ b/plugins/php-apt/versions/all_test.sh @@ -19,7 +19,7 @@ serverPath=$(dirname "$rootPath") # cd /www/server/mdserver-web/plugins/php-apt/versions && /bin/bash common.sh 7.1 install swoole -PHP_VER_LIST=(56 70 71 72 73 74 80 81) +PHP_VER_LIST=(56 70 71 72 73 74 80 81 82 83 84) for PHP_VER in ${PHP_VER_LIST[@]}; do echo "php${PHP_VER} -- start" if [ ! -d /www/server/php-apt/${PHP_VER} ];then @@ -31,7 +31,7 @@ done cd $curPath -PHP_VER_LIST_EXT=(56 70 71 72 73 74 80 81) +PHP_VER_LIST_EXT=(56 70 71 72 73 74 80 81 82 83 84) PHP_EXT_LIST=(ioncube pdo mysqlnd sqlite3 odbc opcache mcrypt fileinfo \ exif gd intl memcache memcached redis imagick xdebug xhprof \ swoole yaf phalcon yar mongodb yac solr seaslog mbstring zip zstd) From db69532ddeff84819c65a36095d898b73a921acc Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 12:12:23 +0800 Subject: [PATCH 24/33] Update openssl.sh --- plugins/php/versions/common/openssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/versions/common/openssl.sh b/plugins/php/versions/common/openssl.sh index d6583329f..2813eff2a 100755 --- a/plugins/php/versions/common/openssl.sh +++ b/plugins/php/versions/common/openssl.sh @@ -35,7 +35,7 @@ fi Install_lib() { if [ "$version" -lt "70" ];then - bash $curPath/openssl_low_version.sh $1 $2 + bash $curPath/openssl_low_version.sh $actionType $version return fi From 6ee1a8dc52fb9adb687f6c6e9e2d461dc4d3f479 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 12:41:57 +0800 Subject: [PATCH 25/33] Update mw.py --- web/core/mw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/core/mw.py b/web/core/mw.py index 15134c210..906811cf4 100644 --- a/web/core/mw.py +++ b/web/core/mw.py @@ -325,7 +325,7 @@ def readFile(filename): fp.close() return fBody except Exception as e: - print('readFile:',str(e)) + # print('readFile:',str(e)) return False def writeFile(filename, content, mode='w+'): From e0c761bdf059efbc6a1c2ec4c3acecdbc2c688b7 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 12:46:07 +0800 Subject: [PATCH 26/33] Update index.py --- plugins/phpmyadmin/index.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/phpmyadmin/index.py b/plugins/phpmyadmin/index.py index 832c62ce4..8a5201505 100755 --- a/plugins/phpmyadmin/index.py +++ b/plugins/phpmyadmin/index.py @@ -13,6 +13,7 @@ if os.path.exists(web_dir): os.chdir(web_dir) import core.mw as mw +import thisdb from utils.site import sites as MwSites app_debug = False @@ -478,7 +479,7 @@ def pluginsDbSupport(): port = getPort() ip = '127.0.0.1' if not mw.isAppleSystem(): - ip = mw.getLocalIp() + ip = thisdb.getOption('server_ip') cfg = data['cfg'] auth = cfg['username']+':'+cfg['password'] From 29cae6ae6c84a1f5b940f5008b5df4fa9c55cb7a Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 12:50:45 +0800 Subject: [PATCH 27/33] Update phplib.conf --- plugins/php/versions/phplib.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 9ebf254e6..6e3a2fe37 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -149,6 +149,7 @@ { "name": "openssl", "versions": [ + "52", "53", "54", "55", From 57ff303c39476ff77a3062aedbfe8bc40a5a43b8 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 12:50:55 +0800 Subject: [PATCH 28/33] Update phplib.conf --- plugins/php/versions/phplib.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 6e3a2fe37..3416ec051 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -166,7 +166,7 @@ "84" ], "type": "通用扩展", - "msg": "SSL!", + "msg": "SSL", "shell": "openssl.sh", "check": "openssl.so" }, From 8cb225779e2c406225416849d60502f47ed960f2 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 12:55:45 +0800 Subject: [PATCH 29/33] Update app_start.php --- plugins/php/conf/app_start.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/php/conf/app_start.php b/plugins/php/conf/app_start.php index cd9b3e011..afbc6bd06 100644 --- a/plugins/php/conf/app_start.php +++ b/plugins/php/conf/app_start.php @@ -46,8 +46,8 @@ function app_xhprof_end() { if (extension_loaded('xhprof') && isset($_GET[XHProf_Name]) && $_GET[XHProf_Name] == 'ok' && - (! in_array($_SERVER['SCRIPT_NAME'], ['/xhprof_html/callgraph.php', - '/xhprof_html/index.php']))) { + (! in_array($_SERVER['SCRIPT_NAME'], array('/xhprof_html/callgraph.php', + '/xhprof_html/index.php'))))) { app_xhprof_start(); register_shutdown_function('app_xhprof_end'); include_once $_SERVER['SCRIPT_FILENAME']; From 4f98894ce4244f6935fff094b96d7732ab5b351f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 12:56:24 +0800 Subject: [PATCH 30/33] Update app_start.php --- plugins/php/conf/app_start.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/php/conf/app_start.php b/plugins/php/conf/app_start.php index afbc6bd06..3473d3963 100644 --- a/plugins/php/conf/app_start.php +++ b/plugins/php/conf/app_start.php @@ -46,8 +46,8 @@ function app_xhprof_end() { if (extension_loaded('xhprof') && isset($_GET[XHProf_Name]) && $_GET[XHProf_Name] == 'ok' && - (! in_array($_SERVER['SCRIPT_NAME'], array('/xhprof_html/callgraph.php', - '/xhprof_html/index.php'))))) { + (! in_array($_SERVER['SCRIPT_NAME'], ['/xhprof_html/callgraph.php', + '/xhprof_html/index.php'])) { app_xhprof_start(); register_shutdown_function('app_xhprof_end'); include_once $_SERVER['SCRIPT_FILENAME']; From 98f267057b350a31a4b0df58865639d4338cc8a8 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 12:59:22 +0800 Subject: [PATCH 31/33] Update app_start.php --- plugins/php/conf/app_start.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/php/conf/app_start.php b/plugins/php/conf/app_start.php index 3473d3963..c03b949d9 100644 --- a/plugins/php/conf/app_start.php +++ b/plugins/php/conf/app_start.php @@ -46,8 +46,7 @@ function app_xhprof_end() { if (extension_loaded('xhprof') && isset($_GET[XHProf_Name]) && $_GET[XHProf_Name] == 'ok' && - (! in_array($_SERVER['SCRIPT_NAME'], ['/xhprof_html/callgraph.php', - '/xhprof_html/index.php'])) { + (! in_array($_SERVER['SCRIPT_NAME'], array('/xhprof_html/callgraph.php','/xhprof_html/index.php')))) { app_xhprof_start(); register_shutdown_function('app_xhprof_end'); include_once $_SERVER['SCRIPT_FILENAME']; From 19efde1fdac6c0a5bea66df636a213043c53081e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 13:00:43 +0800 Subject: [PATCH 32/33] update --- plugins/php-apt/conf/app_start.php | 56 +++++++++++++++++++------------------- plugins/php-yum/conf/app_start.php | 56 +++++++++++++++++++------------------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/plugins/php-apt/conf/app_start.php b/plugins/php-apt/conf/app_start.php index 8a21a7cd4..5bff93d38 100644 --- a/plugins/php-apt/conf/app_start.php +++ b/plugins/php-apt/conf/app_start.php @@ -1,7 +1,7 @@ save_run($xhprof_data, 'xhprof_foo'); + $run_id = $xhprof_runs->save_run($xhprof_data, 'xhprof_foo'); - $profiler_url = sprintf('http://{$LOCAL_IP}:5858/index.php?run=%s&source=xhprof_foo', $run_id); - echo ""; - // echo 'Profiler output'; + $profiler_url = sprintf('http://{$LOCAL_IP}:5858/index.php?run=%s&source=xhprof_foo', $run_id); + echo ""; + // echo 'Profiler output'; } if (extension_loaded('xhprof') - && isset($_GET[XHProf_Name]) && $_GET[XHProf_Name] == 'ok' && - (!in_array($_SERVER['SCRIPT_NAME'], array('/xhprof_html/callgraph.php', - '/xhprof_html/index.php')))) { - app_xhprof_start(); - include_once $_SERVER['SCRIPT_FILENAME']; - app_xhprof_end(); - exit; + && isset($_GET[XHProf_Name]) && $_GET[XHProf_Name] == 'ok' && + (! in_array($_SERVER['SCRIPT_NAME'], ['/xhprof_html/callgraph.php', + '/xhprof_html/index.php']))) { + app_xhprof_start(); + include_once $_SERVER['SCRIPT_FILENAME']; + app_xhprof_end(); + exit; } ?> diff --git a/plugins/php-yum/conf/app_start.php b/plugins/php-yum/conf/app_start.php index 8a21a7cd4..5bff93d38 100644 --- a/plugins/php-yum/conf/app_start.php +++ b/plugins/php-yum/conf/app_start.php @@ -1,7 +1,7 @@ save_run($xhprof_data, 'xhprof_foo'); + $run_id = $xhprof_runs->save_run($xhprof_data, 'xhprof_foo'); - $profiler_url = sprintf('http://{$LOCAL_IP}:5858/index.php?run=%s&source=xhprof_foo', $run_id); - echo ""; - // echo 'Profiler output'; + $profiler_url = sprintf('http://{$LOCAL_IP}:5858/index.php?run=%s&source=xhprof_foo', $run_id); + echo ""; + // echo 'Profiler output'; } if (extension_loaded('xhprof') - && isset($_GET[XHProf_Name]) && $_GET[XHProf_Name] == 'ok' && - (!in_array($_SERVER['SCRIPT_NAME'], array('/xhprof_html/callgraph.php', - '/xhprof_html/index.php')))) { - app_xhprof_start(); - include_once $_SERVER['SCRIPT_FILENAME']; - app_xhprof_end(); - exit; + && isset($_GET[XHProf_Name]) && $_GET[XHProf_Name] == 'ok' && + (! in_array($_SERVER['SCRIPT_NAME'], ['/xhprof_html/callgraph.php', + '/xhprof_html/index.php']))) { + app_xhprof_start(); + include_once $_SERVER['SCRIPT_FILENAME']; + app_xhprof_end(); + exit; } ?> From 43f752afbc3801a76f5eebcfc8b3343c73c07e9a Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 Jan 2025 13:01:57 +0800 Subject: [PATCH 33/33] update --- plugins/php-apt/conf/app_start.php | 6 ++++-- plugins/php-yum/conf/app_start.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/php-apt/conf/app_start.php b/plugins/php-apt/conf/app_start.php index 5bff93d38..5d1b7ce8c 100644 --- a/plugins/php-apt/conf/app_start.php +++ b/plugins/php-apt/conf/app_start.php @@ -35,8 +35,10 @@ function app_xhprof_end() { $run_id = $xhprof_runs->save_run($xhprof_data, 'xhprof_foo'); $profiler_url = sprintf('http://{$LOCAL_IP}:5858/index.php?run=%s&source=xhprof_foo', $run_id); - echo ""; - // echo 'Profiler output'; + // echo ""; + + $style_css = 'position:fixed;bottom: 0px;right: 0px;z-index: 100000000;color: red;background-color: black;padding: 0px;margin: 0px;'; + echo 'XHProf分析结果'; } diff --git a/plugins/php-yum/conf/app_start.php b/plugins/php-yum/conf/app_start.php index 5bff93d38..5d1b7ce8c 100644 --- a/plugins/php-yum/conf/app_start.php +++ b/plugins/php-yum/conf/app_start.php @@ -35,8 +35,10 @@ function app_xhprof_end() { $run_id = $xhprof_runs->save_run($xhprof_data, 'xhprof_foo'); $profiler_url = sprintf('http://{$LOCAL_IP}:5858/index.php?run=%s&source=xhprof_foo', $run_id); - echo ""; - // echo 'Profiler output'; + // echo ""; + + $style_css = 'position:fixed;bottom: 0px;right: 0px;z-index: 100000000;color: red;background-color: black;padding: 0px;margin: 0px;'; + echo 'XHProf分析结果'; }