diff --git a/.gitignore b/.gitignore index 11beb38ba..9b03b43d9 100644 --- a/.gitignore +++ b/.gitignore @@ -142,3 +142,4 @@ data/edate.pl plugins/l2tp plugins/openlitespeed plugins/gdrive +debug.out diff --git a/app.py b/app.py index 13e12f3be..8e63dbc9b 100644 --- a/app.py +++ b/app.py @@ -1,5 +1,10 @@ # coding:utf-8 +# pip install profiler_online +# 性能测试 +# from profiler_online import run_profiler +# run_profiler() + from gevent import monkey monkey.patch_all() diff --git a/class/core/config_api.py b/class/core/config_api.py index 71f991acc..6bca6fc85 100755 --- a/class/core/config_api.py +++ b/class/core/config_api.py @@ -18,7 +18,7 @@ class config_api: # 本版解决自启动问题 # 文件管理重命名 # 优化计划任务管理 - __version = '0.8.6.1' + __version = '0.8.6.2' def __init__(self): pass diff --git a/class/core/files_api.py b/class/core/files_api.py index 8f7974d8f..6ffd23be0 100755 --- a/class/core/files_api.py +++ b/class/core/files_api.py @@ -210,7 +210,6 @@ class files_api: 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': task_pid = mw.execShell( @@ -220,8 +219,7 @@ class files_api: for i in range(len(task_list)): self.removeTaskRecursion(task_list[i]) - isTask = mw.getRootDir() + '/tmp/panelTask.pl' - mw.writeFile(isTask, 'True') + mw.triggerTask() system_api.system_api().restartTask() except: system_api.system_api().restartTask() diff --git a/class/core/mw.py b/class/core/mw.py index 85cc528c6..80530088c 100755 --- a/class/core/mw.py +++ b/class/core/mw.py @@ -89,8 +89,8 @@ def setBackupDir(bdir): def triggerTask(): - isTask = mw.getRunDir() + '/tmp/panelTask.pl' - mw.writeFile(isTask, 'True') + isTask = getRunDir() + '/tmp/panelTask.pl' + writeFile(isTask, 'True') def getOs(): @@ -597,20 +597,29 @@ def getLocalIpBack(): def getLocalIp(): - # 取本地外网IP + filename = 'data/iplist.txt' try: - import re - filename = 'data/iplist.txt' ipaddress = readFile(filename) if not ipaddress or ipaddress == '127.0.0.1': - import urllib - url = 'https://v6r.ipip.net/?format=text' - req = urllib.request.urlopen(url, timeout=10) - ipaddress = req.read().decode('utf-8') - writeFile(filename, ipaddress) + raise return ipaddress - except Exception as ex: - return '127.0.0.1' + except Exception as e: + cmd = "curl -4 -sS --connect-timeout 5 -m 60 https://v6r.ipip.net/?format=text" + ip = execShell(cmd) + result = ip[0].strip() + if result == '': + raise + writeFile(filename, result) + return result + except Exception as e: + cmd = "curl -6 -sS --connect-timeout 5 -m 60 https://v6r.ipip.net/?format=text" + ip = execShell(cmd) + result = ip[0].strip() + if result == '': + return '127.0.0.1' + writeFile(filename, result) + return result + return '127.0.0.1' def inArray(arrays, searchStr): diff --git a/class/core/plugins_api.py b/class/core/plugins_api.py index eb99e2124..77ac43824 100755 --- a/class/core/plugins_api.py +++ b/class/core/plugins_api.py @@ -794,7 +794,7 @@ class plugins_api: return mw.returnJson(True, '删除成功!') # shell 调用 - def run(self, name, func, version, args='', script='index'): + def run(self, name, func, version='', args='', script='index'): path = mw.getRunDir() + '/' + self.__plugin_dir + \ '/' + name + '/' + script + '.py' py = 'python3 ' + path diff --git a/class/core/site_api.py b/class/core/site_api.py index b2960e729..9f94ccd25 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -293,7 +293,7 @@ class site_api: domains.append(tmp) data['domains'] = domains data['email'] = mw.M('users').getField('email') - if data['email'] == '287962566@qq.com': + if data['email'] == 'midoks@163.com': data['email'] = '' return mw.returnJson(True, 'OK', data) @@ -829,6 +829,30 @@ class site_api: port = request.form.get('port', '') return self.add(webname, port, ps, path, version) + def checkWebStatusApi(self): + ''' + 创建站点检查web服务 + ''' + if not mw.isInstalledWeb(): + return mw.returnJson(False, '请安装并启动OpenResty服务!') + + # 这个快点 + pid = mw.getServerDir() + '/openresty/nginx/logs/nginx.pid' + if not os.path.exists(pid): + return mw.returnJson(False, '请启动OpenResty服务!') + + # path = mw.getServerDir() + '/openresty/init.d/openresty' + # data = mw.execShell(path + " status") + # if data[0].strip().find('stopped') != -1: + # return mw.returnJson(False, '请启动OpenResty服务!') + + # import plugins_api + # data = plugins_api.plugins_api().run('openresty', 'status') + # if data[0].strip() == 'stop': + # return mw.returnJson(False, '请启动OpenResty服务!') + + return mw.returnJson(True, 'OK') + def addDomainApi(self): isError = mw.checkWebConfig() if isError != True: @@ -1081,7 +1105,7 @@ class site_api: # self.closeHasPwd(get) filename = self.passPath + '/' + siteName + '.pass' - print(filename) + # print(filename) passconf = username + ':' + mw.hasPwd(password) if siteName == 'phpmyadmin': diff --git a/cli.sh b/cli.sh index abc5d49fc..f38e77abb 100755 --- a/cli.sh +++ b/cli.sh @@ -18,7 +18,6 @@ mw_start(){ mw_start_debug(){ - python3 task.py >> $DIR/logs/task.log 2>&1 & gunicorn -b :7200 -k gevent -w 1 app:app } @@ -36,7 +35,13 @@ mw_stop() do kill -9 $i done - ps -ef|grep task.py |grep -v grep|awk '{print $2}'|xargs kill -9 + + pids=`ps -ef|grep task.py | grep -v grep |awk '{print $2}'` + arr=($pids) + for p in ${arr[@]} + do + kill -9 $p + done } case "$1" in diff --git a/plugins/mongodb/info.json b/plugins/mongodb/info.json index 6172e4ac6..3f3550329 100755 --- a/plugins/mongodb/info.json +++ b/plugins/mongodb/info.json @@ -4,15 +4,15 @@ "name": "mongodb", "title": "Mongodb", "shell": "install.sh", - "versions":["4.4.14","5.0.4"], - "updates":["4.4.14","5.0.4"], + "versions":["4.4","5.0"], + "updates":["4.4","5.0"], "tip": "soft", "checks": "server/mongodb", "path": "server/mongodb", "display": 1, "author": "mongodb", "date": "2021-11-23", - "home": "https://www.mongodb.com/", + "home": "https://www.mongodb.com/docs/v4.4/installation/", "type": 0, "pid": "2" } \ No newline at end of file diff --git a/plugins/mongodb/install.sh b/plugins/mongodb/install.sh index 646d1dc48..a44d66a73 100755 --- a/plugins/mongodb/install.sh +++ b/plugins/mongodb/install.sh @@ -32,6 +32,11 @@ else OSNAME='unknow' fi + +SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + + + Install_app_mac() { @@ -45,13 +50,59 @@ Install_app_mac() } + + +Install_Linux_Ubuntu() +{ +##################### Ubuntu start ##################### + if [ "$SYS_VERSION_ID" == "22" ]; then + echo "Not yet supported" + exit 1 + fi + + + wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - + sudo apt install gnupg + touch /etc/apt/sources.list.d/mongodb-org-4.4.list + lsb_release -dc + + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list +##################### Ubuntu end ##################### +} + +Install_Linux_Debian() +{ +##################### debian start ##################### + +##################### debian end ##################### +} + + # https://repo.mongodb.org/yum/redhat/7/mongodb-org/5.0/x86_64/RPMS/mongodb-org-server-5.0.4-1.el7.x86_64.rpm -Install_app_linux(){ +Install_Linux_CentOS() +{ +##################### centos start ##################### if [ ! -f $serverPath/source/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm ];then wget -O $serverPath/source/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm https://repo.mongodb.org/yum/redhat/7/mongodb-org/5.0/x86_64/RPMS/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm fi - + rpm -ivh $serverPath/source/mongodb-org-server-${VERSION}-1.el7.x86_64.rpm +##################### centos end ##################### +} + + +Install_app_linux() +{ + if [ "$OSNAME" == "ubuntu" ];then + Install_Linux_Ubuntu + elif [ "$OSNAME" == "debian" ];then + Install_Linux_Debian + elif [ "$OSNAME" == "centos" ];then + Install_Linux_CentOS + else + echo "Not yet supported" + exit 1 + fi } diff --git a/plugins/mysql/versions/5.5/install.sh b/plugins/mysql/versions/5.5/install.sh index b7d0a257d..eec5fc632 100755 --- a/plugins/mysql/versions/5.5/install.sh +++ b/plugins/mysql/versions/5.5/install.sh @@ -34,7 +34,7 @@ Install_mysql() fi if [ ! -f ${mysqlDir}/mysql-5.5.62.tar.gz ];then - wget -O ${mysqlDir}/mysql-5.5.62.tar.gz https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.62.tar.gz + wget -O ${mysqlDir}/mysql-5.5.62.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.62.tar.gz fi if [ ! -d ${mysqlDir}/mysql-5.5.62 ];then diff --git a/plugins/mysql/versions/5.6/install.sh b/plugins/mysql/versions/5.6/install.sh index 4937df5aa..4d11114e9 100755 --- a/plugins/mysql/versions/5.6/install.sh +++ b/plugins/mysql/versions/5.6/install.sh @@ -38,13 +38,23 @@ Install_mysql() if [ ! -f ${mysqlDir}/mysql-5.6.50.tar.gz ];then - wget -O ${mysqlDir}/mysql-5.6.50.tar.gz https://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.50.tar.gz + wget -O ${mysqlDir}/mysql-5.6.50.tar.gz --tries=3 https://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.50.tar.gz fi if [ ! -d ${mysqlDir}/mysql-5.6.50 ];then cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-5.6.50.tar.gz fi - + + + OPTIONS='' + ##check openssl version + OPENSSL_VERSION=`openssl version|awk '{print $2}'|awk -F '.' '{print $1}'` + if [ "${OPENSSL_VERSION}" -ge "3" ];then + #openssl version to high + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl" + fi if [ ! -d $serverPath/mysql ];then cd ${mysqlDir}/mysql-5.6.50 && cmake \ @@ -59,9 +69,11 @@ Install_mysql() -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DEXTRA_CHARSETS=all \ -DDEFAULT_CHARSET=utf8mb4 \ + -DDEFAULT_COLLATION=utf8mb4_general_ci \ + $OPTIONS \ -DCMAKE_C_COMPILER=/usr/bin/gcc \ - -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ - -DDEFAULT_COLLATION=utf8mb4_general_ci + -DCMAKE_CXX_COMPILER=/usr/bin/g++ + make clean && make && make install && make clean diff --git a/plugins/mysql/versions/5.7/install.sh b/plugins/mysql/versions/5.7/install.sh index b95f7a311..851cd656b 100755 --- a/plugins/mysql/versions/5.7/install.sh +++ b/plugins/mysql/versions/5.7/install.sh @@ -40,7 +40,7 @@ Install_mysql() if [ ! -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then - wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz + wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz --tries=3 https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz fi #检测文件是否损坏. @@ -52,7 +52,7 @@ Install_mysql() else # 重新下载 rm -rf ${mysqlDir}/mysql-${VERSION} - wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz + wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz --tries=3 https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz fi fi @@ -60,6 +60,16 @@ Install_mysql() cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-${VERSION}.tar.gz fi + OPTIONS='' + ##check openssl version + OPENSSL_VERSION=`openssl version|awk '{print $2}'|awk -F '.' '{print $1}'` + if [ "${OPENSSL_VERSION}" -ge "3" ];then + #openssl version to high + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl" + fi + if [ ! -d $serverPath/mysql ];then cd ${mysqlDir}/mysql-${VERSION} && cmake \ -DCMAKE_INSTALL_PREFIX=$serverPath/mysql \ @@ -75,6 +85,7 @@ Install_mysql() -DDEFAULT_CHARSET=utf8mb4 \ -DDEFAULT_COLLATION=utf8mb4_general_ci \ -DDOWNLOAD_BOOST=1 \ + $OPTIONS \ -DCMAKE_C_COMPILER=/usr/bin/gcc \ -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ -DWITH_BOOST=${mysqlDir}/mysql-${VERSION}/boost/ diff --git a/plugins/mysql/versions/8.0/install.sh b/plugins/mysql/versions/8.0/install.sh index 9603b6d4b..f892ad1d9 100755 --- a/plugins/mysql/versions/8.0/install.sh +++ b/plugins/mysql/versions/8.0/install.sh @@ -59,6 +59,15 @@ Install_mysql() cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-8.0.25.tar.gz fi + OPTIONS='' + ##check openssl version + OPENSSL_VERSION=`openssl version|awk '{print $2}'|awk -F '.' '{print $1}'` + if [ "${OPENSSL_VERSION}" -ge "3" ];then + #openssl version to high + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl" + fi if [ ! -d $serverPath/mysql ];then cd ${mysqlDir}/mysql-8.0.25 && ${INSTALL_CMD} \ @@ -76,6 +85,7 @@ Install_mysql() -DDEFAULT_COLLATION=utf8mb4_general_ci \ -DDOWNLOAD_BOOST=1 \ -DFORCE_INSOURCE_BUILD=1 \ + $OPTIONS \ -DCMAKE_C_COMPILER=/usr/bin/gcc \ -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ -DWITH_BOOST=${mysqlDir}/mysql-8.0.25/boost/ diff --git a/plugins/openresty/info.json b/plugins/openresty/info.json index 29d2f0e54..606fdc769 100755 --- a/plugins/openresty/info.json +++ b/plugins/openresty/info.json @@ -11,6 +11,6 @@ "home":"http://openresty.org", "date":"2017-11-24", "pid": "1", - "versions": ["1.11.2.5", "1.13.6.2","1.15.8.3","1.19.3.1","1.21.4.1"], - "updates": ["1.11.2.5", "1.13.6.2","1.15.8.3","1.19.3.1","1.21.4.1"] + "versions": ["1.15.8.3","1.17.8.2","1.19.3.1","1.21.4.1"], + "updates": ["1.15.8.3","1.17.8.2","1.19.3.1","1.21.4.1"] } \ No newline at end of file diff --git a/plugins/php/all_test.sh b/plugins/php/all_test.sh index e010a8b30..0b4122dcf 100644 --- a/plugins/php/all_test.sh +++ b/plugins/php/all_test.sh @@ -3,139 +3,45 @@ export PATH=$PATH:/opt/local/bin:/opt/local/sbin:/opt/local/share/man:/usr/local DIR=$(cd "$(dirname "$0")"; pwd) -PHP_VER=53 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" +# cd /www/server/mdserver-web/plugins/php && bash all_test.sh + +# cd /www/server/mdserver-web/plugins/php/versions/74/ && bash openssl.sh install 74 +# cd /www/server/mdserver-web/plugins/php/versions/81/ && bash imagemagick.sh install 81 +# cd /www/server/mdserver-web/plugins/php/versions/70/ && bash imagemagick.sh install 70 + +# PHP_VER=52 +# echo "php${PHP_VER} -- start" +# cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') +# cd $DIR && /bin/bash install.sh install $PHP_VER +# for ii in $cmd_ext +# do +# if [ "install.sh" == "$ii" ];then +# echo '' > /tmp/t.log +# else +# cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER +# fi +# done +# echo "php${PHP_VER} -- end" - -PHP_VER=54 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - - -PHP_VER=55 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - - -PHP_VER=56 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - - - -PHP_VER=70 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - - -PHP_VER=71 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - - -PHP_VER=72 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - -PHP_VER=73 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER +PHP_VER_LIST=(53 54 55 56 70 71 72 73 74 80 81) +# PHP_VER_LIST=(81) +for PHP_VER in ${PHP_VER_LIST[@]}; do + echo "php${PHP_VER} -- start" + if [ -d /www/server/php/${PHP_VER} ];then + cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') + for ii in $cmd_ext + do + echo "${ii}" + if [ "install.sh" == "$ii" ];then + echo '' > /tmp/t.log + else + cd $DIR/versions/$PHP_VER/ && bash $ii install ${PHP_VER} + fi + done fi + echo "php${PHP_VER} -- end" done -echo "php${PHP_VER} -- end" -PHP_VER=74 -echo "php${PHP_VER} -- start" -cmd_ext=$(ls -l $DIR/versions/$PHP_VER/ |awk '{print $9}') -cd $DIR && /bin/bash install.sh install $PHP_VER -for ii in $cmd_ext -do - if [ "install.sh" == "$ii" ];then - echo '' > /tmp/t.log - else - cd $DIR/versions/$PHP_VER && /bin/bash $ii install $PHP_VER - fi -done -echo "php${PHP_VER} -- end" - rm -rf /tmp/t.log diff --git a/plugins/php/conf/phpinfo.conf b/plugins/php/conf/phpinfo.conf index 223441d3f..577a70ec0 100644 --- a/plugins/php/conf/phpinfo.conf +++ b/plugins/php/conf/phpinfo.conf @@ -1,4 +1,4 @@ location /{$PHP_VERSION} { root {$ROOT_PATH}/phpinfo; - include enable-php-{$PHP_VERSION}.conf; + include {$SERVER_PATH}/web_conf/php/conf/enable-php-{$PHP_VERSION}.conf; } \ No newline at end of file diff --git a/plugins/php/index.py b/plugins/php/index.py index 6db5faba6..069230fdd 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -605,20 +605,20 @@ def setDisableFunc(version): def checkPhpinfoFile(v): - if mw.isInstalledWeb(): - sdir = mw.getServerDir() - dfile = sdir + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf' - if not os.path.exists(dfile): - tpl = getPluginDir() + '/conf/phpinfo.conf' - content = mw.readFile(tpl) - content = contentReplace(content, v) - mw.writeFile(dfile, content) - mw.restartWeb() + sdir = mw.getServerDir() + dfile = sdir + '/web_conf/php/status/phpinfo_' + v + '.conf' + if not os.path.exists(dfile): + tpl = getPluginDir() + '/conf/phpinfo.conf' + content = mw.readFile(tpl) + content = contentReplace(content, v) + mw.writeFile(dfile, content) + mw.restartWeb() def getPhpinfo(v): checkPhpinfoFile(v) sPath = mw.getRootDir() + '/phpinfo/' + v + mw.execShell("rm -rf " + mw.getRootDir() + '/phpinfo') mw.execShell("mkdir -p " + sPath) mw.writeFile(sPath + '/phpinfo.php', '') @@ -629,6 +629,8 @@ def getPhpinfo(v): def get_php_info(args): + if not mw.isInstalledWeb(): + return "openresty is not running!!!" return getPhpinfo(args['version']) @@ -675,7 +677,7 @@ def installLib(version): name + '.sh' + ' install ' + version rettime = time.strftime('%Y-%m-%d %H:%M:%S') - insert_info = (None, '安装[' + name + '-' + version + ']', + insert_info = (None, '安装[' + name + '-PHP' + version + ']', 'execshell', '0', rettime, execstr) mw.M('tasks').add('id,name,type,status,addtime,execstr', insert_info) diff --git a/plugins/php/lib/libmemcached.sh b/plugins/php/lib/libmemcached.sh new file mode 100644 index 000000000..76297d853 --- /dev/null +++ b/plugins/php/lib/libmemcached.sh @@ -0,0 +1,28 @@ +#!/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") + +# echo $rootPath + +# cd /www/server/mdserver-web/plugins/php/lib && /bin/bash libmemcached.sh + +SERVER_ROOT=$rootPath/lib +SOURCE_ROOT=$rootPath/source/lib + +#----------------------------- libmemcached start -------------------------# +if [ ! -d ${SERVER_ROOT}/libmemcached ];then + cd ${SOURCE_ROOT} + if [ ! -f ${SOURCE_ROOT}/libmemcached-1.0.4.tar.gz ];then + wget -O libmemcached-1.0.4.tar.gz https://launchpad.net/libmemcached/1.0/1.0.4/+download/libmemcached-1.0.4.tar.gz -T 20 + fi + tar -zxf libmemcached-1.0.4.tar.gz + cd libmemcached-1.0.4 + ./configure --prefix=${SERVER_ROOT}/libmemcached -with-memcached && make && make install +fi +#----------------------------- libmemcached end -------------------------# \ No newline at end of file diff --git a/plugins/php/lib/openssl.sh b/plugins/php/lib/openssl.sh new file mode 100644 index 000000000..4d6294eac --- /dev/null +++ b/plugins/php/lib/openssl.sh @@ -0,0 +1,38 @@ +#!/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") + +# echo $rootPath + +SERVER_ROOT=$rootPath/lib +SOURCE_ROOT=$rootPath/source/lib + +# if [ ! -d ${SERVER_ROOT}/openssl ];then +# cd ${SOURCE_ROOT} +# if [ ! -f ${SOURCE_ROOT}/openssl-1.0.2q.tar.gz ];then +# wget https://github.com/midoks/mdserver-web/releases/download/init/openssl-1.0.2q.tar.gz -T 20 +# fi +# tar -zxf openssl-1.0.2q.tar.gz +# cd openssl-1.0.2q +# ./config --openssldir=${SERVER_ROOT}/openssl zlib-dynamic shared +# make && make install +# fi + + +if [ ! -d ${SERVER_ROOT}/openssl ];then + cd ${SOURCE_ROOT} + if [ ! -f ${SOURCE_ROOT}/openssl-1.1.1p.tar.gz ];then + wget -O ${SOURCE_ROOT}/openssl-1.1.1p.tar.gz https://www.openssl.org/source/openssl-1.1.1p.tar.gz + fi + tar -zxvf openssl-1.1.1p.tar.gz + cd openssl-1.1.1p + ./config --prefix=${SERVER_ROOT}/openssl zlib-dynamic shared + make && make install +fi + diff --git a/plugins/php/versions/52/ioncube.sh b/plugins/php/versions/52/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/52/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${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 [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp 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 + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/52/openssl.sh b/plugins/php/versions/52/openssl.sh new file mode 100755 index 000000000..17950eef8 --- /dev/null +++ b/plugins/php/versions/52/openssl.sh @@ -0,0 +1,104 @@ +#!/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=openssl +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 + + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + + 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} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl + 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 reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/53/exif.sh b/plugins/php/versions/53/exif.sh new file mode 100755 index 000000000..f52c194c5 --- /dev/null +++ b/plugins/php/versions/53/exif.sh @@ -0,0 +1,105 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +appPath=$(dirname "$curPath") + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=exif +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 + + FIND_C99=`cat Makefile|grep c99` + if [ "$FIND_C99" == "" ];then + sed -i $BAK 's/CFLAGS \=/CFLAGS \= -std=c99/g' Makefile + fi + + + 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 reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/53/ioncube.sh b/plugins/php/versions/53/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/53/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${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 [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp 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 + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/53/openssl.sh b/plugins/php/versions/53/openssl.sh new file mode 100755 index 000000000..17950eef8 --- /dev/null +++ b/plugins/php/versions/53/openssl.sh @@ -0,0 +1,104 @@ +#!/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=openssl +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 + + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + + 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} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl + 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 reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/53/xdebug.sh b/plugins/php/versions/53/xdebug.sh index aa1ae0d1c..349dfe1c8 100755 --- a/plugins/php/versions/53/xdebug.sh +++ b/plugins/php/versions/53/xdebug.sh @@ -60,7 +60,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/54/ioncube.sh b/plugins/php/versions/54/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/54/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${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 [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp 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 + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/54/openssl.sh b/plugins/php/versions/54/openssl.sh new file mode 100755 index 000000000..17950eef8 --- /dev/null +++ b/plugins/php/versions/54/openssl.sh @@ -0,0 +1,104 @@ +#!/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=openssl +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 + + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + + 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} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl + 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 reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/54/xdebug.sh b/plugins/php/versions/54/xdebug.sh index 7aaf482e3..79bf20805 100755 --- a/plugins/php/versions/54/xdebug.sh +++ b/plugins/php/versions/54/xdebug.sh @@ -57,7 +57,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/55/ioncube.sh b/plugins/php/versions/55/ioncube.sh index 7d8812962..bcd8729ef 100755 --- a/plugins/php/versions/55/ioncube.sh +++ b/plugins/php/versions/55/ioncube.sh @@ -42,7 +42,7 @@ Install_lib() php_lib=$sourcePath/php_lib mkdir -p $php_lib - if [ ! -d $php_lib/ioncube_loaders_lin.tar.gz ];then + if [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz fi @@ -58,7 +58,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/55/openssl.sh b/plugins/php/versions/55/openssl.sh new file mode 100755 index 000000000..17950eef8 --- /dev/null +++ b/plugins/php/versions/55/openssl.sh @@ -0,0 +1,104 @@ +#!/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=openssl +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 + + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + + 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} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl + 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 reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/55/xdebug.sh b/plugins/php/versions/55/xdebug.sh index b57ee4885..decf2180b 100755 --- a/plugins/php/versions/55/xdebug.sh +++ b/plugins/php/versions/55/xdebug.sh @@ -61,7 +61,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/56/ioncube.sh b/plugins/php/versions/56/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/56/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${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 [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp 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 + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/56/openssl.sh b/plugins/php/versions/56/openssl.sh index d93233b72..17950eef8 100755 --- a/plugins/php/versions/56/openssl.sh +++ b/plugins/php/versions/56/openssl.sh @@ -36,20 +36,33 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + 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} if [ ! -f "config.m4" ];then mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl 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 diff --git a/plugins/php/versions/56/xdebug.sh b/plugins/php/versions/56/xdebug.sh index 5a1c06c54..bdac443aa 100755 --- a/plugins/php/versions/56/xdebug.sh +++ b/plugins/php/versions/56/xdebug.sh @@ -59,7 +59,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/56/zendguardloader.sh b/plugins/php/versions/56/zendguardloader.sh index c746acd9f..976101749 100755 --- a/plugins/php/versions/56/zendguardloader.sh +++ b/plugins/php/versions/56/zendguardloader.sh @@ -31,7 +31,8 @@ Install_lib() fi 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 + extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} + extFile=${extDir}/${LIBNAME}.so if [ ! -f "$extFile" ];then @@ -45,8 +46,8 @@ Install_lib() fi cd $php_lib && tar xvf zend-loader-php5.6.tar.gz - cd zend-loader-php5.6* - cp ZendGuardLoader.so $serverPath/php/$version/lib/php/extensions/no-debug-non-zts-20131226/ + cd zend-loader-php5.6-* + cp ZendGuardLoader.so ${extDir} fi diff --git a/plugins/php/versions/70/imagemagick.sh b/plugins/php/versions/70/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/70/imagemagick.sh +++ b/plugins/php/versions/70/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/70/ioncube.sh b/plugins/php/versions/70/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/70/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${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 [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp 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 + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/70/openssl.sh b/plugins/php/versions/70/openssl.sh new file mode 100755 index 000000000..17950eef8 --- /dev/null +++ b/plugins/php/versions/70/openssl.sh @@ -0,0 +1,104 @@ +#!/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=openssl +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 + + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + + 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} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl + 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 reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/70/xdebug.sh b/plugins/php/versions/70/xdebug.sh index 98de7fdcf..e55391fed 100755 --- a/plugins/php/versions/70/xdebug.sh +++ b/plugins/php/versions/70/xdebug.sh @@ -58,7 +58,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/70/xhprof.sh b/plugins/php/versions/70/xhprof.sh index 759081253..78654123f 100755 --- a/plugins/php/versions/70/xhprof.sh +++ b/plugins/php/versions/70/xhprof.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=xhprof -LIBV=2.3.5 +LIBV=2.1.2 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/70/yac.sh b/plugins/php/versions/70/yac.sh index 46292d91d..2687801c0 100755 --- a/plugins/php/versions/70/yac.sh +++ b/plugins/php/versions/70/yac.sh @@ -17,7 +17,7 @@ version=$2 sysName=`uname` LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 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 diff --git a/plugins/php/versions/70/yaf.sh b/plugins/php/versions/70/yaf.sh index c82c102a0..94543b9cc 100755 --- a/plugins/php/versions/70/yaf.sh +++ b/plugins/php/versions/70/yaf.sh @@ -18,7 +18,7 @@ version=$2 sysName=`uname` LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.2.2 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 diff --git a/plugins/php/versions/71/imagemagick.sh b/plugins/php/versions/71/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/71/imagemagick.sh +++ b/plugins/php/versions/71/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/71/intl.sh b/plugins/php/versions/71/intl.sh index c58d8741c..a0374a4f0 100755 --- a/plugins/php/versions/71/intl.sh +++ b/plugins/php/versions/71/intl.sh @@ -42,10 +42,13 @@ Install_lib() cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash icu.sh + cd $sourcePath/php${version}/ext/${LIBNAME} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-icu-dir=${serverPath}/lib/icu make && make install && make clean diff --git a/plugins/php/versions/71/ioncube.sh b/plugins/php/versions/71/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/71/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${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 [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp 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 + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/71/openssl.sh b/plugins/php/versions/71/openssl.sh index 165e01bd2..17950eef8 100755 --- a/plugins/php/versions/71/openssl.sh +++ b/plugins/php/versions/71/openssl.sh @@ -36,6 +36,8 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + if [ ! -f "$extFile" ];then if [ ! -d $sourcePath/php${version}/ext ];then @@ -48,8 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/71/xdebug.sh b/plugins/php/versions/71/xdebug.sh index 0c9fa0c18..8fbb08afd 100755 --- a/plugins/php/versions/71/xdebug.sh +++ b/plugins/php/versions/71/xdebug.sh @@ -57,7 +57,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/71/yac.sh b/plugins/php/versions/71/yac.sh index 9107616af..b34f952b8 100755 --- a/plugins/php/versions/71/yac.sh +++ b/plugins/php/versions/71/yac.sh @@ -16,7 +16,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 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 diff --git a/plugins/php/versions/71/yaf.sh b/plugins/php/versions/71/yaf.sh index f5d2c9a88..1e224d8f3 100755 --- a/plugins/php/versions/71/yaf.sh +++ b/plugins/php/versions/71/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.3.5 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 diff --git a/plugins/php/versions/72/imagemagick.sh b/plugins/php/versions/72/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/72/imagemagick.sh +++ b/plugins/php/versions/72/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/72/intl.sh b/plugins/php/versions/72/intl.sh index c58d8741c..a0374a4f0 100755 --- a/plugins/php/versions/72/intl.sh +++ b/plugins/php/versions/72/intl.sh @@ -42,10 +42,13 @@ Install_lib() cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash icu.sh + cd $sourcePath/php${version}/ext/${LIBNAME} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-icu-dir=${serverPath}/lib/icu make && make install && make clean diff --git a/plugins/php/versions/72/ioncube.sh b/plugins/php/versions/72/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/72/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${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 [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp 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 + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/72/openssl.sh b/plugins/php/versions/72/openssl.sh index 165e01bd2..17950eef8 100755 --- a/plugins/php/versions/72/openssl.sh +++ b/plugins/php/versions/72/openssl.sh @@ -36,6 +36,8 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + if [ ! -f "$extFile" ];then if [ ! -d $sourcePath/php${version}/ext ];then @@ -48,8 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/72/swoole.sh b/plugins/php/versions/72/swoole.sh index 333707bbd..7d11372da 100755 --- a/plugins/php/versions/72/swoole.sh +++ b/plugins/php/versions/72/swoole.sh @@ -16,7 +16,7 @@ version=$2 LIBNAME=swoole -LIBV=4.5.2 +LIBV=4.8.10 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 diff --git a/plugins/php/versions/72/xdebug.sh b/plugins/php/versions/72/xdebug.sh index c08c3dfa9..97ecfdb86 100755 --- a/plugins/php/versions/72/xdebug.sh +++ b/plugins/php/versions/72/xdebug.sh @@ -56,7 +56,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/72/yac.sh b/plugins/php/versions/72/yac.sh index b97b6c742..995a4f9a1 100755 --- a/plugins/php/versions/72/yac.sh +++ b/plugins/php/versions/72/yac.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 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 diff --git a/plugins/php/versions/72/yaf.sh b/plugins/php/versions/72/yaf.sh index e10fcef0c..e14b8a79d 100755 --- a/plugins/php/versions/72/yaf.sh +++ b/plugins/php/versions/72/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.3.5 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` diff --git a/plugins/php/versions/73/imagemagick.sh b/plugins/php/versions/73/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/73/imagemagick.sh +++ b/plugins/php/versions/73/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/73/intl.sh b/plugins/php/versions/73/intl.sh index c58d8741c..a0374a4f0 100755 --- a/plugins/php/versions/73/intl.sh +++ b/plugins/php/versions/73/intl.sh @@ -42,10 +42,13 @@ Install_lib() cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash icu.sh + cd $sourcePath/php${version}/ext/${LIBNAME} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-icu-dir=${serverPath}/lib/icu make && make install && make clean diff --git a/plugins/php/versions/73/ioncube.sh b/plugins/php/versions/73/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/73/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${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 [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp 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 + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/73/openssl.sh b/plugins/php/versions/73/openssl.sh index 165e01bd2..17950eef8 100755 --- a/plugins/php/versions/73/openssl.sh +++ b/plugins/php/versions/73/openssl.sh @@ -36,6 +36,8 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + if [ ! -f "$extFile" ];then if [ ! -d $sourcePath/php${version}/ext ];then @@ -48,8 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/73/swoole.sh b/plugins/php/versions/73/swoole.sh index 5db5d34b2..46a981273 100755 --- a/plugins/php/versions/73/swoole.sh +++ b/plugins/php/versions/73/swoole.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=swoole -LIBV=4.5.2 +LIBV=4.8.10 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 diff --git a/plugins/php/versions/73/xdebug.sh b/plugins/php/versions/73/xdebug.sh index a28100421..e610af9f6 100755 --- a/plugins/php/versions/73/xdebug.sh +++ b/plugins/php/versions/73/xdebug.sh @@ -58,7 +58,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/73/yac.sh b/plugins/php/versions/73/yac.sh index b97b6c742..995a4f9a1 100755 --- a/plugins/php/versions/73/yac.sh +++ b/plugins/php/versions/73/yac.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 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 diff --git a/plugins/php/versions/73/yaf.sh b/plugins/php/versions/73/yaf.sh index 071ecaa34..4c7742f87 100755 --- a/plugins/php/versions/73/yaf.sh +++ b/plugins/php/versions/73/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.3.5 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 diff --git a/plugins/php/versions/74/imagemagick.sh b/plugins/php/versions/74/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/74/imagemagick.sh +++ b/plugins/php/versions/74/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/74/intl.sh b/plugins/php/versions/74/intl.sh index c58d8741c..a0374a4f0 100755 --- a/plugins/php/versions/74/intl.sh +++ b/plugins/php/versions/74/intl.sh @@ -42,10 +42,13 @@ Install_lib() cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash icu.sh + cd $sourcePath/php${version}/ext/${LIBNAME} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-icu-dir=${serverPath}/lib/icu make && make install && make clean diff --git a/plugins/php/versions/74/ioncube.sh b/plugins/php/versions/74/ioncube.sh new file mode 100755 index 000000000..bcd8729ef --- /dev/null +++ b/plugins/php/versions/74/ioncube.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=ioncube +LIBV=0 +sysName=`uname` +actionType=$1 +version=$2 +IC_VERSION=${version:0:1}.${version:1:2} + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extDir=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME} +extFile=${extDir}/${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 [ ! -f $php_lib/ioncube_loaders_lin.tar.gz ];then + wget -O $php_lib/ioncube_loaders_lin.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz + cd $php_lib && tar -zxvf ioncube_loaders_lin.tar.gz + fi + cd $php_lib/ioncube + + cp -rf $php_lib/ioncube/ioncube_loader_lin_${IC_VERSION}.so $extFile + 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp 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 + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/74/openssl.sh b/plugins/php/versions/74/openssl.sh index 165e01bd2..17950eef8 100755 --- a/plugins/php/versions/74/openssl.sh +++ b/plugins/php/versions/74/openssl.sh @@ -36,6 +36,8 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + if [ ! -f "$extFile" ];then if [ ! -d $sourcePath/php${version}/ext ];then @@ -48,8 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/74/swoole.sh b/plugins/php/versions/74/swoole.sh index 1ca2c0d7f..8d80d4d5f 100755 --- a/plugins/php/versions/74/swoole.sh +++ b/plugins/php/versions/74/swoole.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=swoole -LIBV=4.5.2 +LIBV=4.8.10 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` diff --git a/plugins/php/versions/74/xdebug.sh b/plugins/php/versions/74/xdebug.sh index bb2aac870..b8d00c3a0 100755 --- a/plugins/php/versions/74/xdebug.sh +++ b/plugins/php/versions/74/xdebug.sh @@ -60,7 +60,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/74/yac.sh b/plugins/php/versions/74/yac.sh index b97b6c742..995a4f9a1 100755 --- a/plugins/php/versions/74/yac.sh +++ b/plugins/php/versions/74/yac.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 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 diff --git a/plugins/php/versions/74/yaf.sh b/plugins/php/versions/74/yaf.sh index 071ecaa34..4c7742f87 100755 --- a/plugins/php/versions/74/yaf.sh +++ b/plugins/php/versions/74/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.3.5 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 diff --git a/plugins/php/versions/80/imagemagick.sh b/plugins/php/versions/80/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/80/imagemagick.sh +++ b/plugins/php/versions/80/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/80/intl.sh b/plugins/php/versions/80/intl.sh index c58d8741c..a0374a4f0 100755 --- a/plugins/php/versions/80/intl.sh +++ b/plugins/php/versions/80/intl.sh @@ -42,10 +42,13 @@ Install_lib() cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash icu.sh + cd $sourcePath/php${version}/ext/${LIBNAME} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-icu-dir=${serverPath}/lib/icu make && make install && make clean diff --git a/plugins/php/versions/80/openssl.sh b/plugins/php/versions/80/openssl.sh index 165e01bd2..17950eef8 100755 --- a/plugins/php/versions/80/openssl.sh +++ b/plugins/php/versions/80/openssl.sh @@ -36,6 +36,8 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl.sh + if [ ! -f "$extFile" ];then if [ ! -d $sourcePath/php${version}/ext ];then @@ -48,8 +50,10 @@ Install_lib() mv config0.m4 config.m4 fi + export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-openssl make clean && make && make install && make clean fi diff --git a/plugins/php/versions/80/swoole.sh b/plugins/php/versions/80/swoole.sh index f599d070e..c3711d6ad 100755 --- a/plugins/php/versions/80/swoole.sh +++ b/plugins/php/versions/80/swoole.sh @@ -16,7 +16,7 @@ version=$2 LIBNAME=swoole -LIBV=4.6.3 +LIBV=4.8.10 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 diff --git a/plugins/php/versions/80/xdebug.sh b/plugins/php/versions/80/xdebug.sh index 8c31817f5..661f2dcca 100755 --- a/plugins/php/versions/80/xdebug.sh +++ b/plugins/php/versions/80/xdebug.sh @@ -59,7 +59,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/80/yac.sh b/plugins/php/versions/80/yac.sh index b97b6c742..995a4f9a1 100755 --- a/plugins/php/versions/80/yac.sh +++ b/plugins/php/versions/80/yac.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 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 diff --git a/plugins/php/versions/80/yaf.sh b/plugins/php/versions/80/yaf.sh index a74c212ac..f420ee14c 100755 --- a/plugins/php/versions/80/yaf.sh +++ b/plugins/php/versions/80/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.3.0 +LIBV=3.3.5 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` diff --git a/plugins/php/versions/81/imagemagick.sh b/plugins/php/versions/81/imagemagick.sh index fde729fad..7490287e6 100755 --- a/plugins/php/versions/81/imagemagick.sh +++ b/plugins/php/versions/81/imagemagick.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=imagick -LIBV=3.6.0 +LIBV=3.7.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/81/memcached.sh b/plugins/php/versions/81/memcached.sh index 63bfc33ac..80a9d8426 100755 --- a/plugins/php/versions/81/memcached.sh +++ b/plugins/php/versions/81/memcached.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=memcached -LIBV=3.1.5 +LIBV=3.2.0 sysName=`uname` actionType=$1 version=$2 diff --git a/plugins/php/versions/81/swoole.sh b/plugins/php/versions/81/swoole.sh index f599d070e..c3711d6ad 100755 --- a/plugins/php/versions/81/swoole.sh +++ b/plugins/php/versions/81/swoole.sh @@ -16,7 +16,7 @@ version=$2 LIBNAME=swoole -LIBV=4.6.3 +LIBV=4.8.10 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 diff --git a/plugins/php/versions/81/xdebug.sh b/plugins/php/versions/81/xdebug.sh index 8c31817f5..661f2dcca 100755 --- a/plugins/php/versions/81/xdebug.sh +++ b/plugins/php/versions/81/xdebug.sh @@ -59,7 +59,7 @@ Install_lib() 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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/81/yac.sh b/plugins/php/versions/81/yac.sh index b97b6c742..995a4f9a1 100755 --- a/plugins/php/versions/81/yac.sh +++ b/plugins/php/versions/81/yac.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yac -LIBV=2.3.0 +LIBV=2.3.1 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 diff --git a/plugins/php/versions/81/yaf.sh b/plugins/php/versions/81/yaf.sh index 0eebee9fd..f420ee14c 100755 --- a/plugins/php/versions/81/yaf.sh +++ b/plugins/php/versions/81/yaf.sh @@ -15,7 +15,7 @@ actionType=$1 version=$2 LIBNAME=yaf -LIBV=3.2.5 +LIBV=3.3.5 NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 64a1759be..d1c903c96 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -24,12 +24,21 @@ { "name": "ionCube", "versions": [ - "55" + "52", + "53", + "54", + "55", + "56", + "70", + "71", + "72", + "73", + "74" ], "type": "脚本解密", "msg": "用于解密ionCube Encoder加密脚本!", "shell": "ioncube.sh", - "check": "ioncube_loader_lin" + "check": "ioncube.so" }, { "name": "opcache", @@ -54,6 +63,9 @@ { "name": "openssl", "versions": [ + "53", + "54", + "55", "56", "71", "72", diff --git a/plugins/pm2/install.sh b/plugins/pm2/install.sh index eb543160f..9e96542ad 100755 --- a/plugins/pm2/install.sh +++ b/plugins/pm2/install.sh @@ -8,15 +8,46 @@ rootPath=$(dirname "$curPath") rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") - install_tmp=${rootPath}/tmp/mw_install.pl +_os=`uname` +echo "use system: ${_os}" +if [ ${_os} == "Darwin" ]; then + OSNAME='macos' +elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then + OSNAME='centos' +elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then + OSNAME='fedora' +elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then + OSNAME='rocky' +elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then + OSNAME='alma' +elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + OSNAME='debian' +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + OSNAME='ubuntu' +elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then + OSNAME='raspbian' +else + OSNAME='unknow' +fi + + Install_pm2() { echo '正在安装脚本文件...' > $install_tmp - yum install -y nodejs + + curl -o- http://npmjs.org/install.sh | bash - npm install pm2 -g + + if [ "$OSNAME" == 'debian' ] && [ "$OSNAME" == 'ubuntu' ];then + apt install -y nodejs + apt install -y pm2 + else + yum install -y nodejs + npm install pm2 -g + fi + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash mkdir -p $serverPath/pm2 diff --git a/requirements.txt b/requirements.txt index 706e50d8e..193e8ef94 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ flask==2.0.3 flask-session==0.3.2 flask-helper==0.19 cache==1.0.3 -gevent==21.1.2 +gevent==21.12.0 gevent-websocket==0.10.1 psutil==5.9.1 chardet==3.0.4 diff --git a/route/__init__.py b/route/__init__.py index a8e374c0c..d1e3863a6 100755 --- a/route/__init__.py +++ b/route/__init__.py @@ -131,8 +131,8 @@ def publicObject(toObject, func, action=None, get=None): return mw.getJson(data) -@app.route("/test") -def test(): +@app.route("/debug") +def debug(): print(sys.version_info) print(session) os = mw.getOs() diff --git a/route/static/app/site.js b/route/static/app/site.js index dd6ef6853..200515040 100755 --- a/route/static/app/site.js +++ b/route/static/app/site.js @@ -163,8 +163,23 @@ function setWebPs(b, e, a) { },'json'); } +function checkWebStatus(){ + data = syncPost('/site/check_web_status') + if (data.status){ + return true + } + layer.msg(data.msg,{icon:0,time:3000,shade: [0.3, "#000"]}) + return false +} + //添加站点 function webAdd(type) { + checkPass = checkWebStatus() + //未开启openresty,不能继续 + if (!checkPass){ + return + } + if (type == 1) { var array; var str=""; diff --git a/route/static/app/soft.js b/route/static/app/soft.js index 94bca7e5e..8f59f2a80 100755 --- a/route/static/app/soft.js +++ b/route/static/app/soft.js @@ -146,17 +146,6 @@ function getSList(isdisplay) { '' + indexshow + '' + '' + handle + '' + ''; - - // sBody += '' + - // '' + plugin_title + '' + - // '' + plugin.ps + '' + - // '' + softPath + '' + - // '' + state + '' + - // '' + indexshow + '' + - // '' + handle + '' + - // ''; } sBody += pBody; diff --git a/route/static/img/apache.png b/route/static/img/apache.png deleted file mode 100755 index e321bcae0..000000000 Binary files a/route/static/img/apache.png and /dev/null differ diff --git a/route/static/img/mysql.png b/route/static/img/mysql.png deleted file mode 100755 index a0911ee83..000000000 Binary files a/route/static/img/mysql.png and /dev/null differ diff --git a/route/static/img/nginx.png b/route/static/img/nginx.png deleted file mode 100755 index 2303ff099..000000000 Binary files a/route/static/img/nginx.png and /dev/null differ diff --git a/route/static/img/php.png b/route/static/img/php.png deleted file mode 100755 index 4fa965260..000000000 Binary files a/route/static/img/php.png and /dev/null differ diff --git a/scripts/install/alma.sh b/scripts/install/alma.sh index d7ddc4136..1e70f2e15 100755 --- a/scripts/install/alma.sh +++ b/scripts/install/alma.sh @@ -86,10 +86,24 @@ chmod 755 /www/server/mdserver-web/data cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start +cd /www/server/mdserver-web && /etc/init.d/mw default + + + diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index e2b548a1f..de18732a0 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -95,10 +95,22 @@ chmod 755 /www/server/mdserver-web/data cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start +cd /www/server/mdserver-web && /etc/init.d/mw default + diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 8d36831f4..ea3761dd6 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -104,11 +104,25 @@ chmod 755 /www/server/mdserver-web/data cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start +cd /www/server/mdserver-web && /etc/init.d/mw default + + + diff --git a/scripts/install/fedora.sh b/scripts/install/fedora.sh index feec8833d..fbba069c6 100644 --- a/scripts/install/fedora.sh +++ b/scripts/install/fedora.sh @@ -85,12 +85,22 @@ cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data - cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start +cd /www/server/mdserver-web && /etc/init.d/mw default diff --git a/scripts/install/rocky.sh b/scripts/install/rocky.sh index 7d1b6c925..c4cbcf1b5 100644 --- a/scripts/install/rocky.sh +++ b/scripts/install/rocky.sh @@ -84,11 +84,21 @@ chmod 755 /www/server/mdserver-web/data cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start - +cd /www/server/mdserver-web && /etc/init.d/mw default diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index 152c0bb4f..8defa90b2 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -64,11 +64,43 @@ cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + + +if [ "${VERSION_ID}" == "22.04" ];then + pip3 install -U --force-reinstall --no-binary :all: gevent +fi + +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate +else + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate +fi + +if [ "${VERSION_ID}" == "22.04" ];then + pip3 install -U --force-reinstall --no-binary :all: gevent +fi + + cd /www/server/mdserver-web && ./cli.sh start -sleep 5 +isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` +n=0 +while [[ ! -f /etc/init.d/mw ]]; +do + echo -e ".\c" + sleep 1 + let n+=1 + if [ $n -gt 20 ];then + echo -e "start mw fail" + exit 1 + fi +done -cd /www/server/mdserver-web && ./cli.sh stop -cd /www/server/mdserver-web && ./scripts/init.d/mw default +cd /www/server/mdserver-web && /etc/init.d/mw stop cd /www/server/mdserver-web && /etc/init.d/mw start +cd /www/server/mdserver-web && /etc/init.d/mw default + + diff --git a/scripts/lib.sh b/scripts/lib.sh index 2ed03a3ab..0e2718cc0 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -272,16 +272,23 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y devscripts apt install -y net-tools apt install -y python3-dev + apt install -y autoconf apt install -y libffi-dev apt install -y cmake automake make apt install -y webp scons + apt install -y libwebp-dev apt install -y lzma lzma-dev apt install -y libunwind-dev apt install -y libpcre3 libpcre3-dev apt install -y openssl + apt install -y libssl-dev + apt install -y libcurl4-openssl-dev + apt install -y libmemcached-dev + apt install -y libsasl2-dev + apt install -y imagemagick libmagickwand-dev apt install -y libxml2 libxml2-dev libbz2-dev libmcrypt-dev libpspell-dev librecode-dev apt install -y libgmp-dev libgmp3-dev libreadline-dev libxpm-dev @@ -292,10 +299,11 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y libjpeg62-turbo-dev apt install -y libfreetype6-dev apt install -y libevent-dev libncurses5-dev libldap2-dev + apt install -y libzip-dev apt install -y libicu-dev - apt install -y gcc build-essential libssl-dev + apt install -y gcc build-essential apt install -y curl libcurl4-gnutls-dev #https://blog.csdn.net/qq_36228377/article/details/123154344 @@ -348,7 +356,6 @@ pip install --upgrade pip pip3 install --upgrade setuptools cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -pip3 install gunicorn==20.1.0 pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 @@ -358,9 +365,9 @@ pip3 install psutil pip3 install flask-socketio==5.2.0 pip3 install mysqlclient -if [ "${OSNAME}" == "ubuntu" ] && [ "${VERSION_ID}" == "22.04" ];then - pip3 install -U --force-reinstall --no-binary :all: gevent -fi +# if [ "${OSNAME}" == "ubuntu" ] && [ "${VERSION_ID}" == "22.04" ];then +# pip3 install -U --force-reinstall --no-binary :all: gevent +# fi if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . @@ -373,7 +380,6 @@ pip install --upgrade pip pip3 install --upgrade setuptools pip3 install -r /www/server/mdserver-web/requirements.txt -pip3 install gunicorn==20.1.0 pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 @@ -383,9 +389,9 @@ pip3 install psutil pip3 install flask-socketio==5.2.0 pip3 install mysqlclient -if [ "${OSNAME}" == "ubuntu" ] && [ "${VERSION_ID}" == "22.04" ];then - pip3 install -U --force-reinstall --no-binary :all: gevent -fi +# if [ "${OSNAME}" == "ubuntu" ] && [ "${VERSION_ID}" == "22.04" ];then +# pip3 install -U --force-reinstall --no-binary :all: gevent +# fi ##### common start ##### diff --git a/setting.py b/setting.py index c60fd7c9e..235927164 100755 --- a/setting.py +++ b/setting.py @@ -40,7 +40,7 @@ else: bind.append('0.0.0.0:%s' % mw_port) if workers > 2: - workers = 2 + workers = 1 threads = workers * 1 backlog = 512