Merge pull request #113 from midoks/dev

重点加入PHP GD中JPEG支持
This commit is contained in:
Mr Chen
2022-06-29 02:34:29 +08:00
committed by GitHub
42 changed files with 726 additions and 130 deletions
+2 -9
View File
@@ -5,9 +5,9 @@ name: MW APP MySQL80
on:
push:
branches: [ "master","dev" ]
branches: [ "master" ]
pull_request:
branches: [ "master","dev" ]
branches: [ "master" ]
permissions:
contents: read
@@ -31,13 +31,6 @@ jobs:
sudo bash scripts/install_dev.sh
- name: Install MySQL80
run: |
sudo mkdir -p /tmp
sudo echo '' > /tmp/t.log
sudo chmod 777 /www/server/mdserver-web/plugins/mysql/versions/8.0/install.sh
sudo cat /www/server/mdserver-web/plugins/mysql/versions/8.0/install.sh > /tmp/t.log
sudo echo "export MAKEJN=-j12\n" >> /www/server/mdserver-web/plugins/mysql/versions/8.0/install.sh
sudo cat /tmp/t.log >> /www/server/mdserver-web/plugins/mysql/versions/8.0/install.sh
cd /www/server/mdserver-web/plugins/mysql && sudo bash install.sh install 8.0
- name: Start DEBUG
run: |
+38
View File
@@ -0,0 +1,38 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: MW APP OpenResty
on:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master", "dev" ]
permissions:
contents: read
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
#runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install MW
run: |
sudo bash scripts/install_dev.sh
- name: Install OpenResty
run: |
cd /www/server/mdserver-web/plugins/openresty && sudo bash install.sh install 1.21.4.1
- name: Start DEBUG
run: |
gunicorn -c setting.py app:app
python3 task.py &
+68
View File
@@ -0,0 +1,68 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: MW APP PHP
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
#runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install MW
run: |
sudo bash scripts/install_dev.sh
- name: Install PHP53
run: |
cd /www/server/mdserver-web/plugins/php && sudo bash install.sh install 53
- name: Install PHP54
run: |
cd /www/server/mdserver-web/plugins/php && sudo bash install.sh install 54
- name: Install PHP55
run: |
cd /www/server/mdserver-web/plugins/php && sudo bash install.sh install 55
- name: Install PHP56
run: |
cd /www/server/mdserver-web/plugins/php && sudo bash install.sh install 56
- name: Install PHP70
run: |
cd /www/server/mdserver-web/plugins/php && sudo bash install.sh install 70
- name: Install PHP71
run: |
cd /www/server/mdserver-web/plugins/php && sudo bash install.sh install 71
- name: Install PHP72
run: |
cd /www/server/mdserver-web/plugins/php && sudo bash install.sh install 72
- name: Install PHP73
run: |
cd /www/server/mdserver-web/plugins/php && sudo bash install.sh install 73
- name: Install PHP74
run: |
cd /www/server/mdserver-web/plugins/php && sudo bash install.sh install 74
- name: Install PHP80
run: |
cd /www/server/mdserver-web/plugins/php && sudo bash install.sh install 80
- name: Install PHP81
run: |
cd /www/server/mdserver-web/plugins/php && sudo bash install.sh install 81
- name: Start DEBUG
run: |
gunicorn -c setting.py app:app
python3 task.py &
+2 -1
View File
@@ -1,4 +1,5 @@
### mdserver-web 0.8.6
简单的Linux面板,感谢BT.CN写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。
复制了后台管理界面,按照自己想要的方式写了一版。
@@ -18,7 +19,7 @@
基本上可以使用,后续会继续优化!欢迎提供意见!
- https://t.me/mdserver_web
- 吹水组 - https://t.me/mdserver_web
### 主要插件介绍
+22 -16
View File
@@ -191,34 +191,40 @@ class files_api:
# self.setFileAccept(path + '/' + filename)
return mw.returnJson(True, '已将下载任务添加到队列!')
# 删除进程下的所有进程
def removeTaskRecursion(self, pid):
cmd = "ps -ef|grep " + pid + \
" | grep -v grep |sed -n '2,1p' | awk '{print $2}'"
sub_pid = mw.execShell(cmd)
if sub_pid[0].strip() == '':
return 'ok'
self.removeTaskRecursion(sub_pid[0].strip())
mw.execShell('kill -9 ' + sub_pid[0].strip())
return sub_pid[0].strip()
def removeTaskApi(self):
import system_api
mid = request.form.get('id', '')
try:
name = mw.M('tasks').where('id=?', (mid,)).getField('name')
status = mw.M('tasks').where('id=?', (mid,)).getField('status')
# print(name, status)
mw.M('tasks').delete(mid)
if status == '-1':
os.system(
"kill `ps -ef |grep 'python panelSafe.pyc'|grep -v grep|grep -v panelExec|awk '{print $2}'`")
os.system(
"kill `ps aux | grep 'python task.pyc$'|awk '{print $2}'`")
os.system('''
pids=`ps aux | grep 'sh'|grep -v grep|grep install|awk '{print $2}'`
arr=($pids)
task_pid = mw.execShell(
"ps aux | grep 'task.py' | grep -v grep |awk '{print $2}'")
for p in ${arr[@]}
do
kill -9 $p
done
''')
task_list = task_pid[0].strip().split("\n")
for i in range(len(task_list)):
self.removeTaskRecursion(task_list[i])
os.system(
'rm -f ' + name.replace('扫描目录[', '').replace(']', '') + '/scan.pl')
isTask = mw.getRootDir() + '/tmp/panelTask.pl'
mw.writeFile(isTask, 'True')
os.system('/etc/init.d/mw start')
system_api.system_api().restartTask()
except:
os.system('/etc/init.d/mw start')
system_api.system_api().restartTask()
return mw.returnJson(True, '任务已删除!')
# 上传文件
+1
View File
@@ -1660,6 +1660,7 @@ class site_api:
content = content.replace('{$PORT}', self.sitePort)
content = content.replace('{$SERVER_NAME}', self.siteName)
content = content.replace('{$ROOT_DIR}', self.sitePath)
content = content.replace('{$PHP_DIR}', self.setupPath + '/php')
content = content.replace('{$PHPVER}', self.phpVersion)
content = content.replace('{$OR_REWRITE}', self.rewritePath)
+6
View File
@@ -102,6 +102,12 @@ class system_api:
return mw.returnJson(True, '正在重启服务器!')
##### ----- end ----- ###
def restartTask(self):
initd = mw.getRunDir() + '/scripts/init.d/mw'
if os.path.exists(initd):
os.system(initd + ' ' + 'restart_task')
return True
def restartMw(self):
mw.writeFile('data/restart.pl', 'True')
return True
+1 -1
View File
@@ -15,7 +15,7 @@ server
#ERROR-PAGE-END
#PHP-INFO-START
include enable-php-{$PHPVER}.conf;
include {$PHP_DIR}/conf/enable-php-{$PHPVER}.conf;
#PHP-INFO-END
#REWRITE-START
-2
View File
@@ -1,5 +1,3 @@
export MAKEJN=-j12
# -*- coding: utf-8 -*-
#!/bin/bash
+1 -1
View File
@@ -70,7 +70,7 @@ http
stub_status on;
access_log off;
}
include {$SERVER_PATH}/openresty/nginx/conf/php_status/*.conf;
include {$SERVER_PATH}/web_conf/php/status/*.conf;
}
include {$SERVER_PATH}/web_conf/nginx/vhost/*.conf;
}
+10 -1
View File
@@ -136,7 +136,10 @@ def confReplace():
mw.writeFile(nconf, content)
# 静态配置
static_conf = getServerDir() + '/nginx/conf/enable-php-00.conf'
php_conf = mw.getServerDir() + '/web_conf/php/conf'
if not os.path.exists(php_conf):
mw.execShell('mkdir -p ' + php_conf)
static_conf = mw.getServerDir() + '/web_conf/php/conf/enable-php-00.conf'
if not os.path.exists(static_conf):
mw.writeFile(static_conf, '')
@@ -206,6 +209,12 @@ def status():
def restyOp(method):
file = initDreplace()
# 启动时,先检查一下配置文件
check = getServerDir() + "/bin/openresty -t"
check_data = mw.execShell(check)
if check_data[1].find('test failed') != -1:
return check_data[1]
if not mw.isAppleSystem():
data = mw.execShell('systemctl ' + method + ' openresty')
if data[1] == '':
+14 -3
View File
@@ -49,18 +49,29 @@ Install_openresty()
if [ -d $serverPath/openresty ];then
echo "${VERSION}" > $serverPath/openresty/version.pl
echo "" > $serverPath/openresty/nginx/conf/enable-php-00.conf
echo "" > $serverPath/web_conf/php/conf/enable-php-00.conf
#初始化
cd ${rootPath} && python3 ${rootPath}/plugins/openresty/index.py start
cd ${rootPath} && python3 ${rootPath}/plugins/openresty/index.py initd_install
fi
echo '安装完成' > $install_tmp
}
Uninstall_openresty()
{
rm -rf $serverPath/openresty
if [ -f /lib/systemd/system/openresty.service ];then
systemctl stop openresty
rm -rf /lib/systemd/system/openresty.service
systemctl daemon-reload
fi
if [ -f $serverPath/openresty/init.d/openresty ];then
$serverPath/openresty/init.d/openresty stop
fi
rm -rf $serverPath/openresty
echo '卸载完成' > $install_tmp
}
+4 -4
View File
@@ -97,12 +97,12 @@ function orPluginOpServiceOp(a,b,c,d,a,v){
}
if( g.status && g.data != 'ok' ) {
layer.msg(g.data, {icon: 2,time: 3000,shade: 0.3,shadeClose: true});
layer.msg(g.data, {icon: 2,time: 10000,shade: 0.3});
}
setTimeout(function(){
location.reload();
},2000);
// setTimeout(function(){
// location.reload();
// },2000);
},'json').error(function() {
layer.close(e);
layer.msg('操作异常!', {icon: 2});
+1 -1
View File
@@ -4,5 +4,5 @@ location ~ [^/]\.php(/|$)
fastcgi_pass unix:/tmp/php-cgi-{$PHP_VERSION}.sock;
fastcgi_index index.php;
include fastcgi.conf;
include pathinfo.conf;
include {$SERVER_PATH}/web_conf/php/pathinfo.conf;
}
+46 -30
View File
@@ -122,37 +122,49 @@ def contentReplace(content, version):
def makeOpenrestyConf():
phpversions = ['00', '52', '53', '54', '55', '56',
'70', '71', '72', '73', '74', '80', '81']
if mw.isInstalledWeb():
sdir = mw.getServerDir()
d_pathinfo = sdir + '/openresty/nginx/conf/pathinfo.conf'
if not os.path.exists(d_pathinfo):
s_pathinfo = getPluginDir() + '/conf/pathinfo.conf'
shutil.copyfile(s_pathinfo, d_pathinfo)
info = getPluginDir() + '/info.json'
content = mw.readFile(info)
content = json.loads(content)
versions = content['versions']
tpl = getPluginDir() + '/conf/enable-php.conf'
tpl_content = mw.readFile(tpl)
for x in phpversions:
dfile = sdir + '/openresty/nginx/conf/enable-php-' + x + '.conf'
if not os.path.exists(dfile):
if x == '00':
mw.writeFile(dfile, '')
else:
w_content = contentReplace(tpl_content, x)
mw.writeFile(dfile, w_content)
sdir = mw.getServerDir()
# php-fpm status
for version in phpversions:
dfile = sdir + '/openresty/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
if not os.path.exists(dfile):
content = mw.readFile(tpl)
content = contentReplace(content, version)
mw.writeFile(dfile, content)
mw.restartWeb()
dst_dir = sdir + '/web_conf/php'
dst_dir_conf = sdir + '/web_conf/php/conf'
dst_dir_status = sdir + '/web_conf/php/status'
if not os.path.exists(dst_dir):
mw.execShell('mkdir -p ' + dst_dir)
if not os.path.exists(dst_dir_conf):
mw.execShell('mkdir -p ' + dst_dir_conf)
if not os.path.exists(dst_dir_status):
mw.execShell('mkdir -p ' + dst_dir_status)
d_pathinfo = sdir + '/web_conf/php/pathinfo.conf'
if not os.path.exists(d_pathinfo):
s_pathinfo = getPluginDir() + '/conf/pathinfo.conf'
shutil.copyfile(s_pathinfo, d_pathinfo)
info = getPluginDir() + '/info.json'
content = mw.readFile(info)
content = json.loads(content)
versions = content['versions']
tpl = getPluginDir() + '/conf/enable-php.conf'
tpl_content = mw.readFile(tpl)
for x in phpversions:
dfile = sdir + '/web_conf/php/conf/enable-php-' + x + '.conf'
if not os.path.exists(dfile):
if x == '00':
mw.writeFile(dfile, '')
else:
w_content = contentReplace(tpl_content, x)
mw.writeFile(dfile, w_content)
# php-fpm status
for version in phpversions:
dfile = sdir + '/web_conf/php/status/phpfpm_status_' + version + '.conf'
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
if not os.path.exists(dfile):
content = mw.readFile(tpl)
content = contentReplace(content, version)
mw.writeFile(dfile, content)
def phpPrependFile(version):
@@ -537,6 +549,10 @@ def checkFpmStatusFile(version):
def getFpmStatus(version):
checkFpmStatusFile(version)
stat = status(version)
if stat == 'stop':
return mw.returnJson(False, 'PHP[' + version + ']未启动!!!')
try:
url = 'http://' + mw.getHostAddr() + '/phpfpm_status_' + version + '?json'
result = mw.httpGet(url)
@@ -552,7 +568,7 @@ def getFpmStatus(version):
except Exception as e:
data = {}
return mw.getJson(data)
return mw.returnJson(True, "OK", data)
def getDisableFunc(version):
+21 -1
View File
@@ -31,4 +31,24 @@ if [ ! -d $curPath/versions/$2 ];then
exit 0
fi
sh -x $curPath/versions/$2/install.sh $1
if [ "${action}" == "uninstall" ];then
#初始化
cd ${rootPath} && python3 ${rootPath}/plugins/php/index.py stop ${type}
cd ${rootPath} && python3 ${rootPath}/plugins/php/index.py initd_uninstall ${type}
if [ -f /lib/systemd/system/php${type}.service ];then
systemctl stop php${type}
rm -rf /lib/systemd/system/php${type}.service
systemctl daemon-reload
fi
fi
cd ${curPath} && sh -x $curPath/versions/$2/install.sh $1
if [ "${action}" == "install" ];then
#初始化
cd ${rootPath} && python3 ${rootPath}/plugins/php/index.py start ${type}
cd ${rootPath} && python3 ${rootPath}/plugins/php/index.py initd_install ${type}
fi
+7 -1
View File
@@ -312,7 +312,13 @@ function setFpmConfig(version){
function getFpmStatus(version){
phpPost('get_fpm_status', version, '', function(ret_data){
var rdata = $.parseJSON(ret_data.data);
var tmp_data = $.parseJSON(ret_data.data);
if(!tmp_data.status){
layer.msg(tmp_data.msg, { icon: tmp_data.status ? 1 : 2 });
return;
}
var rdata = tmp_data.data;
var con = "<div style='height:420px;overflow:hidden;'><table class='table table-hover table-bordered GetPHPStatus' style='margin:0;padding:0'>\
<tr><th>应用池(pool)</th><td>" + rdata.pool + "</td></tr>\
<tr><th>进程管理方式(process manager)</th><td>" + ((rdata['process manager'] == 'dynamic') ? '动态' : '静态') + "</td></tr>\
+107
View File
@@ -0,0 +1,107 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
actionType=$1
version=$2
LIBNAME=gd
LIBV=0
NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts`
extFile=$serverPath/php/${version}/lib/php/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
ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so
ln -s /usr/lib64/libpng.so /usr/lib/
cp -frp /usr/lib64/libldap* /usr/lib/
if [ ! -f "$extFile" ];then
if [ ! -d $sourcePath/php${version}/ext ];then
cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version}
fi
cd $sourcePath/php${version}/ext/${LIBNAME}
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config \
--with-gd \
--with-jpeg-dir=/usr/lib \
--with-freetype-dir=${serverPath}/lib/freetype_old \
--enable-gd-native-ttf \
--enable-gd-jis-conv
make clean && make && make install && make clean
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
$serverPath/php/init.d/php${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
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi
+14 -20
View File
@@ -36,19 +36,19 @@ else
fi
if [ "$OSNAME" == 'ubuntu' ] || [ "$OSNAME" == 'debian' ] ;then
apt install bison=2.4.1
if [ "$?" != "0" ]; then
echo 'The system version is too high to install'
exit 1
fi
# if [ "$OSNAME" == 'ubuntu' ] || [ "$OSNAME" == 'debian' ] ;then
# apt install bison=2.4.1
# if [ "$?" != "0" ]; then
# echo 'The system version is too high to install'
# exit 1
# fi
apt install flex=2.5.4
if [ "$?" != "0" ]; then
echo 'The system version is too high to install'
exit 1
fi
fi
# apt install flex=2.5.4
# if [ "$?" != "0" ]; then
# echo 'The system version is too high to install'
# exit 1
# fi
# fi
version=5.2.17
@@ -116,32 +116,26 @@ if [ $sysName == 'Darwin' ]; then
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype_old"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-curl"
fi
if [ ! -d $serverPath/php/${PHP_VER} ];then
ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so
ln -s /usr/lib64/libpng.so /usr/lib/
cp -frp /usr/lib64/libldap* /usr/lib/
export MYSQL_LIB_DIR=/usr/lib64/mysql
export MYSQL_LIB_DIR=/usr/lib64/mysql
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 \
--with-zlib-dir=$serverPath/lib/zlib \
--enable-xml \
--enable-mysqlnd \
--enable-shared \
--with-mysql=mysqlnd \
--enable-embedded-mysqli=shared \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--disable-fileinfo \
$OPTIONS \
--enable-fastcgi \
--enable-fpm
+2 -1
View File
@@ -48,6 +48,7 @@ else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype_old"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-jpeg --with-jpeg-dir=/usr/lib"
OPTIONS="${OPTIONS} --with-curl"
fi
@@ -85,7 +86,7 @@ if [ ! -d $serverPath/php/53 ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make clean && make ${MAKEJN:--j2} && make install && make clean
make clean && make && make install && make clean
fi
+2 -1
View File
@@ -42,6 +42,7 @@ else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype_old"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-jpeg --with-jpeg-dir=/usr/lib"
OPTIONS="${OPTIONS} --with-curl"
fi
@@ -70,7 +71,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
$OPTIONS \
--enable-fpm
make clean && make ${MAKEJN:--j2}
make clean && make
#debian11,没有生成php54 man
if [ ! -f sapi/cli/php.1 ];then
+2 -1
View File
@@ -41,6 +41,7 @@ else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype_old"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-jpeg --with-jpeg-dir=/usr/lib"
OPTIONS="${OPTIONS} --with-curl"
fi
@@ -68,7 +69,7 @@ if [ ! -d $serverPath/php/55 ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make clean && make ${MAKEJN:--j2} && make install && make clean
make clean && make && make install && make clean
fi
#------------------------ install end ------------------------------------#
+2 -1
View File
@@ -41,6 +41,7 @@ else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype_old"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-jpeg --with-jpeg-dir=/usr/lib"
OPTIONS="${OPTIONS} --with-curl"
fi
@@ -71,7 +72,7 @@ if [ ! -d $serverPath/php/56 ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make clean && make ${MAKEJN:--j2} && make install && make clean
make clean && make && make install && make clean
fi
#------------------------ install end ------------------------------------#
+2 -1
View File
@@ -41,6 +41,7 @@ else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype_old"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-jpeg --with-jpeg-dir=/usr/lib"
OPTIONS="${OPTIONS} --with-curl"
fi
@@ -67,7 +68,7 @@ if [ ! -d $serverPath/php/70 ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make clean && make ${MAKEJN:--j2} && make install && make clean
make clean && make && make install && make clean
fi
#------------------------ install end ------------------------------------#
+2 -1
View File
@@ -40,6 +40,7 @@ else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype_old"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-jpeg --with-jpeg-dir=/usr/lib"
OPTIONS="${OPTIONS} --with-curl"
fi
@@ -67,7 +68,7 @@ if [ ! -d $serverPath/php/71 ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make clean && make ${MAKEJN:--j2} && make install && make clean
make clean && make && make install && make clean
fi
#------------------------ install end ------------------------------------#
+2 -1
View File
@@ -41,6 +41,7 @@ else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype_old"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-jpeg --with-jpeg-dir=/usr/lib"
OPTIONS="${OPTIONS} --with-curl"
fi
@@ -68,7 +69,7 @@ if [ ! -d $serverPath/php/72 ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make clean && make ${MAKEJN:--j2} && make install && make clean
make clean && make && make install && make clean
fi
#------------------------ install end ------------------------------------#
+3 -2
View File
@@ -44,7 +44,8 @@ if [ $sysName == 'Darwin' ]; then
else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype_old"
OPTIONS="${OPTIONS} --with-gd"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-jpeg --with-jpeg-dir=/usr/lib"
OPTIONS="${OPTIONS} --with-curl"
OPTIONS="${OPTIONS} --with-libzip=${serverPath}/lib/libzip"
fi
@@ -72,7 +73,7 @@ if [ ! -d $serverPath/php/73 ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make clean && make ${MAKEJN:--j2} && make install && make clean
make clean && make && make install && make clean
fi
#------------------------ install end ------------------------------------#
+103
View File
@@ -0,0 +1,103 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
actionType=$1
version=$2
LIBNAME=gd
LIBV=0
NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts`
extFile=$serverPath/php/${version}/lib/php/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
if [ ! -f "$extFile" ];then
if [ ! -d $sourcePath/php${version}/ext ];then
cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version}
fi
cd $sourcePath/php${version}/ext/${LIBNAME}
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config \
--enable-gd \
--with-webp \
--with-xpm \
--with-jpeg \
--with-freetype \
--enable-gd-jis-conv
make clean && make && make install && make clean
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
$serverPath/php/init.d/php${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
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi
+1 -1
View File
@@ -80,7 +80,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make ${MAKEJN:--j2} && make install && make clean
make && make install && make clean
fi
#------------------------ install end ------------------------------------#
}
+103
View File
@@ -0,0 +1,103 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
actionType=$1
version=$2
LIBNAME=gd
LIBV=0
NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts`
extFile=$serverPath/php/${version}/lib/php/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
if [ ! -f "$extFile" ];then
if [ ! -d $sourcePath/php${version}/ext ];then
cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version}
fi
cd $sourcePath/php${version}/ext/${LIBNAME}
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config \
--enable-gd \
--with-webp \
--with-xpm \
--with-jpeg \
--with-freetype \
--enable-gd-jis-conv
make clean && make && make install && make clean
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
$serverPath/php/init.d/php${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
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi
+1 -1
View File
@@ -78,7 +78,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make clean && make ${MAKEJN:--j2} && make install && make clean
make clean && make && make install && make clean
fi
#------------------------ install end ------------------------------------#
}
+103
View File
@@ -0,0 +1,103 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
actionType=$1
version=$2
LIBNAME=gd
LIBV=0
NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts`
extFile=$serverPath/php/${version}/lib/php/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
if [ ! -f "$extFile" ];then
if [ ! -d $sourcePath/php${version}/ext ];then
cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version}
fi
cd $sourcePath/php${version}/ext/${LIBNAME}
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config \
--enable-gd \
--with-webp \
--with-xpm \
--with-jpeg \
--with-freetype \
--enable-gd-jis-conv
make clean && make && make install && make clean
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
$serverPath/php/init.d/php${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
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi
+1 -2
View File
@@ -51,7 +51,6 @@ if [ $sysName == 'Darwin' ]; then
else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype"
OPTIONS="${OPTIONS} --with-gd"
OPTIONS="${OPTIONS} --with-curl"
OPTIONS="${OPTIONS} --with-libzip=${serverPath}/lib/libzip"
fi
@@ -83,7 +82,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make clean && make ${MAKEJN:--j2} && make install && make clean
make clean && make && make install && make clean
fi
#------------------------ install end ------------------------------------#
}
+13
View File
@@ -140,6 +140,19 @@
"shell": "exif.sh",
"check": "exif.so"
},
{
"name": "gd",
"versions": [
"52",
"74",
"80",
"81"
],
"type": "通用扩展",
"msg": "通用GD库!",
"shell": "gd.sh",
"check": "gd.so"
},
{
"name": "intl",
"versions": [
+1 -1
View File
@@ -6,7 +6,7 @@ server
root {$SERVER_PATH}/phpmyadmin;
#error_page 404 /404.html;
include enable-php-{$PHP_VER}.conf;
include {$PHP_CONF_PATH}/enable-php-{$PHP_VER}.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
+2
View File
@@ -98,8 +98,10 @@ def contentReplace(content):
service_path = mw.getServerDir()
php_ver = getCachePhpVer()
# print php_ver
php_conf_dir = mw.getServerDir() + '/web_conf/php/conf'
content = content.replace('{$ROOT_PATH}', mw.getRootDir())
content = content.replace('{$SERVER_PATH}', service_path)
content = content.replace('{$PHP_CONF_PATH}', php_conf_dir)
content = content.replace('{$PHP_VER}', php_ver)
return content
+3
View File
@@ -184,6 +184,9 @@ case "$1" in
'restart_panel')
mw_stop_panel
mw_start_panel;;
'restart_task')
mw_stop_task
mw_start_task;;
'status') mw_status;;
'logs') error_logs;;
'default')
+3
View File
@@ -77,6 +77,9 @@ dnf install -y lsof net-tools
dnf install -y ncurses-devel cmake
dnf --enablerepo=crb install mysql-devel
for yumPack in make cmake gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel patch wget libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel tar bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel vim-minimal gettext gettext-devel ncurses-devel gmp-devel pspell-devel libcap diffutils ca-certificates net-tools libc-client-devel psmisc libXpm-devel git-core c-ares-devel libicu-devel libxslt libxslt-devel zip unzip glibc.i686 libstdc++.so.6 cairo-devel bison-devel ncurses-devel libaio-devel perl perl-devel perl-Data-Dumper lsof vixie-cron crontabs expat-devel readline-devel;
do yum -y install $yumPack;done
cd /www/server/mdserver-web/scripts && bash lib.sh
chmod 755 /www/server/mdserver-web/data
+5 -1
View File
@@ -83,7 +83,11 @@ yum install -y python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-d
yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel
yum install -y lsof net-tools
yum install -y ncurses-devel cmake
yum install -y MySQL-python
yum install -y MySQL-python
for yumPack in make cmake gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel patch wget libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel tar bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel vim-minimal gettext gettext-devel ncurses-devel gmp-devel pspell-devel libcap diffutils ca-certificates net-tools libc-client-devel psmisc libXpm-devel git-core c-ares-devel libicu-devel libxslt libxslt-devel zip unzip glibc.i686 libstdc++.so.6 cairo-devel bison-devel ncurses-devel libaio-devel perl perl-devel perl-Data-Dumper lsof vixie-cron crontabs expat-devel readline-devel;
do yum -y install $yumPack;done
cd /www/server/mdserver-web/scripts && bash lib.sh
+2 -1
View File
@@ -78,7 +78,8 @@ yum -y install python-devel
yum -y install MySQL-python
yum -y install python3-devel
for yumPack in make cmake gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel patch wget libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel tar bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel vim-minimal gettext gettext-devel ncurses-devel gmp-devel pspell-devel libcap diffutils ca-certificates net-tools libc-client-devel psmisc libXpm-devel git-core c-ares-devel libicu-devel libxslt libxslt-devel zip unzip glibc.i686 libstdc++.so.6 cairo-devel bison-devel ncurses-devel libaio-devel perl perl-devel perl-Data-Dumper lsof vixie-cron crontabs expat-devel readline-devel;
do yum -y install $yumPack;done
cd /www/server/mdserver-web/scripts && bash lib.sh
chmod 755 /www/server/mdserver-web/data
+2
View File
@@ -76,6 +76,8 @@ yum install -y lsof net-tools
yum install -y ncurses-devel mysql-devel cmake
yum install -y MySQL-python
for yumPack in make cmake gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel patch wget libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel tar bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel vim-minimal gettext gettext-devel ncurses-devel gmp-devel pspell-devel libcap diffutils ca-certificates net-tools libc-client-devel psmisc libXpm-devel git-core c-ares-devel libicu-devel libxslt libxslt-devel zip unzip glibc.i686 libstdc++.so.6 cairo-devel bison-devel ncurses-devel libaio-devel perl perl-devel perl-Data-Dumper lsof vixie-cron crontabs expat-devel readline-devel;
do yum -y install $yumPack;done
cd /www/server/mdserver-web/scripts && bash lib.sh
chmod 755 /www/server/mdserver-web/data
+1 -23
View File
@@ -202,28 +202,6 @@ Install_OpenSSL()
echo -e "Install_OpenSSL" >> ${libPath}/lib.pl
}
Install_Lib()
{
if [ -f "/www/server/nginx/sbin/nginx" ] || [ -f "/www/server/apache/bin/httpd" ] || [ -f "/www/server/mysql/bin/mysql" ]; then
return
fi
lockFile='${libPath}/data/mw_lib.lock'
if [ ! -f "${lockFile}" ];then
sed -i "s#SELINUX=enforcing#SELINUX=disabled#" /etc/selinux/config
rpm -e --nodeps mariadb-libs-*
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
rm -f /var/run/yum.pid
for yumPack in make cmake gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel patch wget libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel tar bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel vim-minimal gettext gettext-devel ncurses-devel gmp-devel pspell-devel libcap diffutils ca-certificates net-tools libc-client-devel psmisc libXpm-devel git-core c-ares-devel libicu-devel libxslt libxslt-devel zip unzip glibc.i686 libstdc++.so.6 cairo-devel bison-devel ncurses-devel libaio-devel perl perl-devel perl-Data-Dumper lsof pcre pcre-devel vixie-cron crontabs expat-devel readline-devel;
do yum -y install $yumPack;done
mv /etc/yum.repos.d/epel.repo.backup /etc/yum.repos.d/epel.repo
groupadd www
useradd -s /sbin/nologin -M -g www www
echo 'true' > $lockFile
fi
}
Install_Curl()
{
@@ -337,7 +315,7 @@ else
yum install -y bison re2c cmake
yum install -y libmemcached libmemcached-devel
yum install -y curl-devel
yum install -y curl curl-devel
yum install -y zlib zlib-devel
yum install -y libzip libzip-devel
yum install -y pcre pcre-devel