commit
149fe72324
|
|
@ -8,7 +8,8 @@ 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
|
||||
port = 33206
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
||||
|
|
|
|||
|
|
@ -10,15 +10,18 @@ serverPath=$(dirname "$rootPath")
|
|||
# https://dev.mysql.com/downloads/mysql/
|
||||
# https://downloads.mysql.com/archives/community/
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
# 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 && source bin/activate && python3 plugins/mysql/index.py do_full_sync {"db":"xxx","sign":"","begin":1}
|
||||
# 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 && python3 plugins/mysql/index.py do_full_sync {"db":"xxx","sign":"","begin":1}
|
||||
|
||||
action=$1
|
||||
type=$2
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
if (isset($_GET['mw_opcache_reset']) && $_GET['mw_opcache_reset'] == 'ok'){
|
||||
opcache_reset();
|
||||
if (isset($_GET['mw_opcache_reset']) && $_GET['mw_opcache_reset'] == 'ok') {
|
||||
opcache_reset();
|
||||
}
|
||||
|
||||
define('XHProf_Name', 'mdd');
|
||||
|
|
@ -11,43 +11,45 @@ define('XHProf_Name', 'mdd');
|
|||
*/
|
||||
|
||||
function app_xhprof_start() {
|
||||
$root = '{$ROOT_PATH}';
|
||||
$lib = $root . '/server/xhprof/xhprof_lib/utils/xhprof_lib.php';
|
||||
if (file_exists($lib)) {
|
||||
include_once $lib;
|
||||
include_once $root . '/server/xhprof/xhprof_lib/utils/xhprof_runs.php';
|
||||
xhprof_enable();
|
||||
}
|
||||
$root = '{$ROOT_PATH}';
|
||||
$lib = $root . '/server/xhprof/xhprof_lib/utils/xhprof_lib.php';
|
||||
if (file_exists($lib)) {
|
||||
include_once $lib;
|
||||
include_once $root . '/server/xhprof/xhprof_lib/utils/xhprof_runs.php';
|
||||
xhprof_enable();
|
||||
}
|
||||
}
|
||||
|
||||
function app_xhprof_end() {
|
||||
|
||||
$root = '{$ROOT_PATH}';
|
||||
$lib = $root . '/server/xhprof';
|
||||
if (!file_exists($lib)) {
|
||||
return;
|
||||
}
|
||||
$root = '{$ROOT_PATH}';
|
||||
$lib = $root . '/server/xhprof';
|
||||
if (! file_exists($lib)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//保存xhprof数据
|
||||
$xhprof_data = xhprof_disable();
|
||||
$xhprof_runs = new XHProfRuns_Default();
|
||||
//保存xhprof数据
|
||||
$xhprof_data = xhprof_disable();
|
||||
$xhprof_runs = new XHProfRuns_Default();
|
||||
|
||||
$run_id = $xhprof_runs->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 "<script language='javascript'>window.open('{$profiler_url}')</script>";
|
||||
// echo '<a href="' . $profiler_url . '" target="_blank">Profiler output</a>';
|
||||
$profiler_url = sprintf('http://{$LOCAL_IP}:5858/index.php?run=%s&source=xhprof_foo', $run_id);
|
||||
// echo "<script language='javascript'>window.open('{$profiler_url}')</script>";
|
||||
|
||||
$style_css = 'position:fixed;bottom: 0px;right: 0px;z-index: 100000000;color: red;background-color: black;padding: 0px;margin: 0px;';
|
||||
echo '<a href="' . $profiler_url . '" target="_blank" style="' . $style_css . '">XHProf分析结果</a>';
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
if (isset($_GET['mw_opcache_reset']) && $_GET['mw_opcache_reset'] == 'ok'){
|
||||
opcache_reset();
|
||||
if (isset($_GET['mw_opcache_reset']) && $_GET['mw_opcache_reset'] == 'ok') {
|
||||
opcache_reset();
|
||||
}
|
||||
|
||||
define('XHProf_Name', 'mdd');
|
||||
|
|
@ -11,43 +11,45 @@ define('XHProf_Name', 'mdd');
|
|||
*/
|
||||
|
||||
function app_xhprof_start() {
|
||||
$root = '{$ROOT_PATH}';
|
||||
$lib = $root . '/server/xhprof/xhprof_lib/utils/xhprof_lib.php';
|
||||
if (file_exists($lib)) {
|
||||
include_once $lib;
|
||||
include_once $root . '/server/xhprof/xhprof_lib/utils/xhprof_runs.php';
|
||||
xhprof_enable();
|
||||
}
|
||||
$root = '{$ROOT_PATH}';
|
||||
$lib = $root . '/server/xhprof/xhprof_lib/utils/xhprof_lib.php';
|
||||
if (file_exists($lib)) {
|
||||
include_once $lib;
|
||||
include_once $root . '/server/xhprof/xhprof_lib/utils/xhprof_runs.php';
|
||||
xhprof_enable();
|
||||
}
|
||||
}
|
||||
|
||||
function app_xhprof_end() {
|
||||
|
||||
$root = '{$ROOT_PATH}';
|
||||
$lib = $root . '/server/xhprof';
|
||||
if (!file_exists($lib)) {
|
||||
return;
|
||||
}
|
||||
$root = '{$ROOT_PATH}';
|
||||
$lib = $root . '/server/xhprof';
|
||||
if (! file_exists($lib)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//保存xhprof数据
|
||||
$xhprof_data = xhprof_disable();
|
||||
$xhprof_runs = new XHProfRuns_Default();
|
||||
//保存xhprof数据
|
||||
$xhprof_data = xhprof_disable();
|
||||
$xhprof_runs = new XHProfRuns_Default();
|
||||
|
||||
$run_id = $xhprof_runs->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 "<script language='javascript'>window.open('{$profiler_url}')</script>";
|
||||
// echo '<a href="' . $profiler_url . '" target="_blank">Profiler output</a>';
|
||||
$profiler_url = sprintf('http://{$LOCAL_IP}:5858/index.php?run=%s&source=xhprof_foo', $run_id);
|
||||
// echo "<script language='javascript'>window.open('{$profiler_url}')</script>";
|
||||
|
||||
$style_css = 'position:fixed;bottom: 0px;right: 0px;z-index: 100000000;color: red;background-color: black;padding: 0px;margin: 0px;';
|
||||
echo '<a href="' . $profiler_url . '" target="_blank" style="' . $style_css . '">XHProf分析结果</a>';
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
|
|
@ -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'];
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
||||
|
|
@ -132,9 +132,17 @@ 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
|
||||
break
|
||||
|
||||
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:
|
||||
|
|
@ -146,10 +154,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):
|
||||
if os.path.getsize(sofile) == 7:
|
||||
lib['status'] = True
|
||||
libs.append(lib)
|
||||
return libs
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ if [ "${SYS_ARCH}" == "aarch64" ];then
|
|||
OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu"
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
||||
|
||||
export MYSQL_LIB_DIR=/usr/lib64/mysql
|
||||
|
|
|
|||
|
|
@ -115,7 +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 [ ! -d $serverPath/php/${PHP_VER} ];then
|
||||
cd $sourcePath/php/php${PHP_VER} && ./configure \
|
||||
--prefix=$serverPath/php/${PHP_VER} \
|
||||
|
|
|
|||
|
|
@ -103,12 +103,26 @@ 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@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"
|
||||
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} \
|
||||
--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 \
|
||||
|
|
|
|||
|
|
@ -105,12 +105,26 @@ 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@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"
|
||||
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} \
|
||||
--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 \
|
||||
|
|
|
|||
|
|
@ -101,12 +101,26 @@ 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@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"
|
||||
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} \
|
||||
--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 \
|
||||
|
|
|
|||
|
|
@ -105,12 +105,26 @@ else
|
|||
fi
|
||||
# ----- cpu end ------
|
||||
|
||||
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@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"
|
||||
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} \
|
||||
--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 \
|
||||
|
|
|
|||
|
|
@ -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@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"
|
||||
else
|
||||
OPTIONS="$OPTIONS --with-openssl"
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
||||
cd $sourcePath/php/php${PHP_VER} && make clean
|
||||
./configure \
|
||||
|
|
@ -115,6 +128,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 \
|
||||
|
|
|
|||
|
|
@ -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@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"
|
||||
else
|
||||
OPTIONS="$OPTIONS --with-openssl"
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
||||
cd $sourcePath/php/php${PHP_VER}
|
||||
./buildconf --force
|
||||
|
|
@ -116,6 +129,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 \
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
@ -108,6 +121,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 \
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
@ -110,6 +123,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 \
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
@ -111,6 +123,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 \
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -104,8 +117,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 \
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -34,106 +34,24 @@ fi
|
|||
|
||||
Install_lib()
|
||||
{
|
||||
if [ "$version" -lt "70" ];then
|
||||
bash $curPath/openssl_low_version.sh $actionType $version
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
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
|
||||
echo "locked" > $extFile
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -149,6 +149,7 @@
|
|||
{
|
||||
"name": "openssl",
|
||||
"versions": [
|
||||
"52",
|
||||
"53",
|
||||
"54",
|
||||
"55",
|
||||
|
|
@ -165,7 +166,7 @@
|
|||
"84"
|
||||
],
|
||||
"type": "通用扩展",
|
||||
"msg": "SSL!",
|
||||
"msg": "SSL",
|
||||
"shell": "openssl.sh",
|
||||
"check": "openssl.so"
|
||||
},
|
||||
|
|
@ -187,6 +188,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",
|
||||
|
|
|
|||
|
|
@ -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']
|
||||
|
|
|
|||
|
|
@ -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+'):
|
||||
|
|
|
|||
Loading…
Reference in New Issue