diff --git a/.github/workflows/python-app-mysql55.yml b/.github/workflows/python-app-mysql55.yml new file mode 100644 index 000000000..7b9635fed --- /dev/null +++ b/.github/workflows/python-app-mysql55.yml @@ -0,0 +1,38 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: MW APP MySQL55 + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + strategy: + matrix: + os: [ubuntu-20.04, ubuntu-18.04, ubuntu-22.04] + runs-on: ${{ matrix.os }} + #runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install MW + run: | + sudo bash scripts/install_dev.sh + - name: Install MySQL55 + run: | + cd /www/server/mdserver-web/plugins/mysql && sudo bash install.sh install 5.5 + - name: Start DEBUG + run: | + gunicorn -c setting.py app:app + python3 task.py & diff --git a/.github/workflows/python-app-mysql56.yml b/.github/workflows/python-app-mysql56.yml new file mode 100644 index 000000000..4a3503415 --- /dev/null +++ b/.github/workflows/python-app-mysql56.yml @@ -0,0 +1,38 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: MW APP MySQL56 + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + #runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install MW + run: | + sudo bash scripts/install_dev.sh + - name: Install MySQL56 + run: | + cd /www/server/mdserver-web/plugins/mysql && sudo bash install.sh install 5.6 + - name: Start DEBUG + run: | + gunicorn -c setting.py app:app + python3 task.py & diff --git a/.github/workflows/python-app-mysql57.yml b/.github/workflows/python-app-mysql57.yml new file mode 100644 index 000000000..b52612299 --- /dev/null +++ b/.github/workflows/python-app-mysql57.yml @@ -0,0 +1,38 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: MW APP MySQL57 + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + #runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install MW + run: | + sudo bash scripts/install_dev.sh + - name: Install MySQL57 + run: | + cd /www/server/mdserver-web/plugins/mysql && sudo bash install.sh install 5.7 + - name: Start DEBUG + run: | + gunicorn -c setting.py app:app + python3 task.py & diff --git a/.github/workflows/python-app-mysql8.yml b/.github/workflows/python-app-mysql80.yml similarity index 100% rename from .github/workflows/python-app-mysql8.yml rename to .github/workflows/python-app-mysql80.yml 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/README.md b/README.md index 7e6f3fbab..f3d928237 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,13 @@ # Note +``` phpMyAdmin[4.4.15]支持MySQL[5.5-5.7] phpMyAdmin[5.2.0]支持MySQL[8.0] PHP[53-72]支持phpMyAdmin[4.4.15] PHP[72-81]支持phpMyAdmin[5.2.0] +``` @@ -83,7 +85,7 @@ curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update_cn.s ### 通用安装 ``` -curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/quick/app.sh | bash +curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/app.sh | bash ``` 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 beb8347f8..80530088c 100755 --- a/class/core/mw.py +++ b/class/core/mw.py @@ -88,6 +88,11 @@ def setBackupDir(bdir): return writeFile(file, bdir) +def triggerTask(): + isTask = getRunDir() + '/tmp/panelTask.pl' + writeFile(isTask, 'True') + + def getOs(): return sys.platform @@ -592,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 ba3ff7c85..77ac43824 100755 --- a/class/core/plugins_api.py +++ b/class/core/plugins_api.py @@ -125,8 +125,7 @@ class plugins_api: mw.M('tasks').add('id,name,type,status,addtime, execstr', taskAdd) # 任务执行相关 - isTask = mw.getRootDir() + '/tmp/panelTask.pl' - mw.writeFile(isTask, 'True') + mw.triggerTask() return mw.returnJson(True, '已将安装任务添加到队列!') def uninstallOldApi(self): @@ -795,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 1f8c7a7f5..dcf46424e 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -3,6 +3,7 @@ import time import os import sys +from urllib.parse import urlparse import mw import re import json @@ -44,6 +45,11 @@ class site_api: mw.execShell("mkdir -p " + self.redirectPath + " && chmod -R 755 " + self.redirectPath) + self.proxyPath = self.setupPath + '/nginx/proxy' + if not os.path.exists(self.proxyPath): + mw.execShell("mkdir -p " + self.proxyPath + + " && chmod -R 755 " + self.proxyPath) + self.logsPath = mw.getRootDir() + '/wwwlogs' # ssl conf if mw.isAppleSystem(): @@ -287,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) @@ -574,9 +580,12 @@ class site_api: file = self.getHostConf(siteName) if os.path.exists(file): siteConf = mw.readFile(file) - if siteConf.find('301-START') != -1: + if siteConf.find('301-END') != -1: return mw.returnJson(False, '检测到您的站点做了301重定向设置,请先关闭重定向!') + if siteConf.find('PROXY-END') != -1: + return mw.returnJson(False, '检测到您的站点做了反向代理设置,请先关闭反向代理!') + letpath = self.sslDir + siteName csrpath = letpath + "/fullchain.pem" # 生成证书路径 keypath = letpath + "/privkey.pem" # 密钥文件路径 @@ -780,6 +789,10 @@ class site_api: siteName = request.form.get('siteName', '') return self.getLogs(siteName) + def getErrorLogsApi(self): + siteName = request.form.get('siteName', '') + return self.getErrorLogs(siteName) + def getSitePhpVersionApi(self): siteName = request.form.get('siteName', '') return self.getSitePhpVersion(siteName) @@ -823,6 +836,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: @@ -1075,7 +1112,7 @@ class site_api: # self.closeHasPwd(get) filename = self.passPath + '/' + siteName + '.pass' - print(filename) + # print(filename) passconf = username + ':' + mw.hasPwd(password) if siteName == 'phpmyadmin': @@ -1176,6 +1213,31 @@ class site_api: path = request.form.get('path', '0') return self.delete(sid, webname, path) + # 操作 重定向配置 + def operateRedirectConf(self, siteName, method='start'): + vhost_file = self.vhostPath + '/' + siteName + '.conf' + content = mw.readFile(vhost_file) + + cnf_301 = ''' + #301-START + include %s/*.conf; + #301-END +''' % (self.getRedirectPath( siteName)) + + cnf_301_source = ''' + #301-START +''' + # print('operateRedirectConf', content.find('#301-END')) + if content.find('#301-END') != -1: + if method == 'stop': + rep = '#301-START(\n|.){1,500}#301-END' + content = re.sub(rep, '#301-START', content) + else: + if method == 'start': + content = re.sub(cnf_301_source, cnf_301, content) + + mw.writeFile(vhost_file, content) + # get_redirect_status def getRedirectApi(self): _siteName = request.form.get("siteName", '') @@ -1230,8 +1292,9 @@ class site_api: if rule_test != True: mw.writeFile("{}/{}/{}.conf".format(self.redirectPath, _siteName, _id), _old_config) - return mw.returnJson(False, "Nginx 配置测试不通过, 请重试: {}".format(rule_test)) + return mw.returnJson(False, "OpenResty 配置测试不通过, 请重试: {}".format(rule_test)) + self.operateRedirectConf(_siteName, 'start') mw.restartWeb() return mw.returnJson(True, "ok") @@ -1309,6 +1372,8 @@ class site_api: mw.writeFile(data_path, json.dumps(data)) mw.writeFile( "{}/{}.conf".format(self.getRedirectPath(_siteName), _id), file_content) + + self.operateRedirectConf(_siteName, 'start') mw.restartWeb() return mw.returnJson(True, "ok") @@ -1330,6 +1395,9 @@ class site_api: break # write database mw.writeFile(data_path, json.dumps(data)) + # data is empty ,should stop + if len(data) == 0: + self.operateRedirectConf(_siteName, 'stop') # remove conf file mw.execShell( "rm -rf {}/{}.conf".format(self.getRedirectPath(_siteName), _id)) @@ -1337,21 +1405,161 @@ class site_api: return mw.returnJson(False, "删除失败!") return mw.returnJson(True, "删除成功!") - def getProxyListApi(self): - siteName = request.form.get('siteName', '') - conf_path = self.getHostConf(siteName) - old_conf = mw.readFile(conf_path) - rep = "(#PROXY-START(\n|.)+#PROXY-END)" - url_rep = "proxy_pass (.*);|ProxyPass\s/\s(.*)|Host\s(.*);" - host_rep = "Host\s(.*);" + # 操作 反向代理配置 + def operateProxyConf(self, siteName, method='start'): + vhost_file = self.vhostPath + '/' + siteName + '.conf' + content = mw.readFile(vhost_file) - proxyUrl = self.__read_config(self.__proxyfile) - sitename = sitename - proxylist = [] - for i in proxyUrl: - if i["sitename"] == sitename: - proxylist.append(i) - return mw.getJson(proxylist) + proxy_cnf = ''' + #PROXY-START + include %s/*.conf; + #PROXY-END +''' % (self.getProxyPath(siteName)) + + proxy_cnf_source = ''' + #PROXY-START +''' + + if content.find('#PROXY-END') != -1: + if method == 'stop': + rep = '#PROXY-START(\n|.){1,500}#PROXY-END' + content = re.sub(rep, '#PROXY-START', content) + else: + if method == 'start': + content = re.sub(proxy_cnf_source, proxy_cnf, content) + + mw.writeFile(vhost_file, content) + + # 读取 网站 反向代理列表 + def getProxyListApi(self): + _siteName = request.form.get('siteName', '') + + data_path = self.getProxytDataPath(_siteName) + data_content = mw.readFile(data_path) + + # not exists + if data_content == False: + mw.execShell("mkdir {}/{}".format(self.proxyPath, _siteName)) + return mw.returnJson(True, "", {"result": [], "count": 0}) + + try: + data = json.loads(data_content) + except: + mw.execShell("rm -rf {}/{}".format(self.proxyPath, _siteName)) + return mw.returnJson(True, "", {"result": [], "count": 0}) + + return mw.returnJson(True, "ok", {"result": data, "count": len(data)}) + + # 设置 网站 反向代理列表 + def setProxyApi(self): + _siteName = request.form.get('siteName', '') + _from = request.form.get('from', '') + _to = request.form.get('to', '') + _host = request.form.get('host', '') + + if _siteName == "" or _from == "" or _to == "" or _host == "": + return mw.returnJson(False, "必填项不能为空") + + data_path = self.getProxytDataPath(_siteName) + data_content = mw.readFile( + data_path) if os.path.exists(data_path) else "" + data = json.loads(data_content) if data_content != "" else [] + + rep = "http(s)?\:\/\/([a-zA-Z0-9][-a-zA-Z0-9]{0,62}\.)+([a-zA-Z0-9][a-zA-Z0-9]{0,62})+.?" + if not re.match(rep, _to): + return mw.returnJson(False, "错误的目标地址!") + + # get host from url + try: + if _host == "$host": + host_tmp = urlparse(_to) + _host = host_tmp.netloc + except: + return mw.returnJson(False, "错误的目标地址") + + tpl = """ +#PROXY-START/ +location ~* \.(gif|png|jpg|css|js|woff|woff2)$ +{ + proxy_pass {to}; + proxy_set_header Host {host}; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header REMOTE-HOST $remote_addr; + expires 12h; +} +location ~* ^{from}(.*)$ { + proxy_pass {to}; + proxy_set_header Host {host}; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header REMOTE-HOST $remote_addr; + + add_header X-Cache $upstream_cache_status; + proxy_ignore_headers Set-Cookie Cache-Control expires; + add_header Cache-Control no-cache; +} +#PROXY-END/ + """ + + # replace + if _from[0] != '/': + _from = '/' + _from + tpl = tpl.replace("{from}", _from, 999) + tpl = tpl.replace("{to}", _to) + tpl = tpl.replace("{host}", _host, 999) + + _id = mw.md5("{}+{}+{}".format(_from, _to, _siteName)) + for item in data: + if item["id"] == _id: + return mw.returnJson(False, "已存在该规则!") + if item["from"] == _from: + return mw.returnJson(False, "已存在该规则!") + data.append({ + "from": _from, + "to": _to, + "host": _host, + "id": _id + }) + mw.writeFile(data_path, json.dumps(data)) + mw.writeFile( + "{}/{}.conf".format(self.getProxyPath(_siteName), _id), tpl) + + self.operateProxyConf(_siteName, 'start') + mw.restartWeb() + return mw.returnJson(True, "ok", { + "hash": _id + }) + + def delProxyApi(self): + _siteName = request.form.get("siteName", '') + _id = request.form.get("id", '') + if _id == '' or _siteName == '': + return mw.returnJson(False, "必填项不能为空!") + + try: + data_path = self.getProxytDataPath(_siteName) + data_content = mw.readFile( + data_path) if os.path.exists(data_path) else "" + data = json.loads(data_content) if data_content != "" else [] + for item in data: + if item["id"] == _id: + data.remove(item) + break + # write database + mw.writeFile(data_path, json.dumps(data)) + + # data is empty,should stop + if len(data) == 0: + self.operateProxyConf(_siteName, 'stop') + # remove conf file + mw.execShell( + "rm -rf {}/{}.conf".format(self.getProxyPath(_siteName), _id)) + except: + return mw.returnJson(False, "删除失败!") + + mw.restartWeb() + return mw.returnJson(True, "删除成功!") def getSiteTypesApi(self): # 取网站分类 @@ -1508,7 +1716,13 @@ class site_api: return "{}/{}/data.json".format(self.redirectPath, siteName) def getRedirectPath(self, siteName): - return "{}/{}/".format(self.redirectPath, siteName) + return "{}/{}".format(self.redirectPath, siteName) + + def getProxytDataPath(self, siteName): + return "{}/{}/data.json".format(self.proxyPath, siteName) + + def getProxyPath(self, siteName): + return "{}/{}".format(self.proxyPath, siteName) def getDirBindRewrite(self, siteName, dirname): return self.rewritePath + '/' + siteName + '_' + dirname + '.conf' @@ -1527,6 +1741,12 @@ class site_api: return mw.returnJson(False, '日志为空') return mw.returnJson(True, mw.getNumLines(logPath, 100)) + def getErrorLogs(self, siteName): + logPath = mw.getLogsDir() + '/' + siteName + '.error.log' + if not os.path.exists(logPath): + return mw.returnJson(False, '日志为空') + return mw.returnJson(True, mw.getNumLines(logPath, 100)) + # 取日志状态 def getLogsStatus(self, siteName): filename = self.getHostConf(siteName) @@ -1766,10 +1986,10 @@ class site_api: def createRootDir(self, path): if not os.path.exists(path): os.makedirs(path) - if not mw.isAppleSystem(): - mw.execShell('chown -R www:www ' + path) - mw.writeFile(path + '/index.html', 'Work has started!!!') - mw.execShell('chmod -R 755 ' + path) + if not mw.isAppleSystem(): + mw.execShell('chown -R www:www ' + path) + mw.writeFile(path + '/index.html', 'Work has started!!!') + mw.execShell('chmod -R 755 ' + path) def nginxAddDomain(self, webname, domain, port): file = self.getHostConf(webname) @@ -1807,7 +2027,8 @@ class site_api: content = content.replace('{$PHP_DIR}', self.setupPath + '/php') content = content.replace('{$PHPVER}', self.phpVersion) content = content.replace('{$OR_REWRITE}', self.rewritePath) - content = content.replace('{$OR_REDIRECT}', self.redirectPath) + # content = content.replace('{$OR_REDIRECT}', self.redirectPath) + # content = content.replace('{$OR_PROXY}', self.proxyPath) logsPath = mw.getLogsDir() content = content.replace('{$LOGPATH}', logsPath) @@ -1815,6 +2036,10 @@ class site_api: rewrite_content = ''' location /{ + if ($PHP_ENV != "1"){ + break; + } + if (!-e $request_filename) { rewrite ^(.*)$ /index.php/$1 last; break; @@ -1869,18 +2094,28 @@ location /{ errLogPath = mw.getLogsDir() + '/' + webname + '.error.log' confFile = self.setupPath + '/nginx/vhost/' + webname + '.conf' rewriteFile = self.setupPath + '/nginx/rewrite/' + webname + '.conf' - rewriteFile = self.setupPath + '/nginx/pass/' + webname + '.conf' + passFile = self.setupPath + '/nginx/pass/' + webname + '.conf' keyPath = self.sslDir + webname + '/privkey.pem' certPath = self.sslDir + webname + '/fullchain.pem' logs = [assLogPath, errLogPath, confFile, rewriteFile, + passFile, keyPath, certPath] for i in logs: mw.deleteFile(i) + # 重定向目录 + redirectDir = self.setupPath + '/nginx/redirect/' + webname + if os.path.exists(redirectDir): + mw.execShell('rm -rf ' + redirectDir) + # 代理目录 + proxyDir = self.setupPath + '/nginx/proxy/' + webname + if os.path.exists(proxyDir): + mw.execShell('rm -rf ' + proxyDir) + def delete(self, sid, webname, path): self.deleteWSLogs(webname) if path == '1': 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/data/tpl/nginx.conf b/data/tpl/nginx.conf index 504cc6e8b..ab258fc46 100755 --- a/data/tpl/nginx.conf +++ b/data/tpl/nginx.conf @@ -8,6 +8,10 @@ server #SSL-START #error_page 404/404.html; #SSL-END + + #301-START + + #PROXY-START #ERROR-PAGE-START error_page 404 /404.html; @@ -21,10 +25,7 @@ server #REWRITE-START include {$OR_REWRITE}/{$SERVER_NAME}.conf; #REWRITE-END - - #301-START - include {$OR_REDIRECT}/{$SERVER_NAME}/*.conf; - ##301-END + #禁止访问的文件或目录 location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md) diff --git a/plugins/clean/ico.png b/plugins/clean/ico.png index 55caa2038..2d534cabc 100644 Binary files a/plugins/clean/ico.png and b/plugins/clean/ico.png differ diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index 0305e1157..26fc280c7 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -104,80 +104,41 @@ def initDreplace(): return file_bin -def start(): +def mgOp(method): + file = initDreplace() if mw.isAppleSystem(): - file = initDreplace() - data = mw.execShell(file + ' start') + data = mw.execShell(file + ' ' + method) if data[1] == '': return 'ok' - return 'fail' + return data[1] - cmd = 'systemctl start mongod' + cmd = 'systemctl ' + method + ' mongod' if os.path.exists("/usr/lib/systemd/system/mongodb.service"): - cmd = 'systemctl start mongodb' + cmd = 'systemctl ' + start + ' mongodb' data = mw.execShell(cmd) if data[1] == '': return 'ok' - return 'fail' + return data[1] + + +def start(): + return mgOp('start') def stop(): - if mw.isAppleSystem(): - file = initDreplace() - data = mw.execShell(file + ' stop') - if data[1] == '': - return 'ok' - return 'fail' - - cmd = 'systemctl stop mongod' - if os.path.exists("/usr/lib/systemd/system/mongodb.service"): - cmd = 'systemctl stop mongodb' - - data = mw.execShell(cmd) - if data[1] == '': - return 'ok' - return 'fail' + return mgOp('stop') def reload(): - if os.path.exists("/tmp/mongodb-27017.sock"): - mw.execShell('rm -rf ' + "/tmp/mongodb-27017.sock") - if mw.isAppleSystem(): - file = initDreplace() - data = mw.execShell(file + ' reload') - if data[1] == '': - return 'ok' - return 'fail' - - cmd = 'systemctl reload mongod' - if os.path.exists("/usr/lib/systemd/system/mongodb.service"): - cmd = 'systemctl reload mongodb' - - data = mw.execShell(cmd) - if data[1] == '': - return 'ok' - return 'fail' + return mgOp('reload') def restart(): if os.path.exists("/tmp/mongodb-27017.sock"): mw.execShell('rm -rf ' + "/tmp/mongodb-27017.sock") - if mw.isAppleSystem(): - file = initDreplace() - data = mw.execShell(file + ' reload') - if data[1] == '': - return 'ok' - return 'fail' - cmd = 'systemctl reload mongod' - if os.path.exists("/usr/lib/systemd/system/mongodb.service"): - cmd = 'systemctl reload mongodb' - - data = mw.execShell(cmd) - if data[1] == '': - return 'ok' - return 'fail' + return mgOp('restart') def runInfo(): @@ -218,15 +179,8 @@ def runInfo(): def initdStatus(): - if not app_debug: - if mw.isAppleSystem(): - return "Apple Computer does not support" - if mw.isAppleSystem(): - initd_bin = getInitDFile() - if os.path.exists(initd_bin): - return 'ok' - return 'fail' + return "Apple Computer does not support" shell_cmd = 'systemctl status mongod | grep loaded | grep "enabled;"' @@ -240,17 +194,8 @@ def initdStatus(): def initdInstall(): - import shutil - if not app_debug: - if mw.isAppleSystem(): - return "Apple Computer does not support" - if mw.isAppleSystem(): - source_bin = initDreplace() - initd_bin = getInitDFile() - shutil.copyfile(source_bin, initd_bin) - mw.execShell('chmod +x ' + initd_bin) - mw.execShell('chkconfig --add ' + getPluginName()) + return "Apple Computer does not support" if os.path.exists("/usr/lib/systemd/system/mongodb.service"): mw.execShell('systemctl enable mongodb') @@ -260,13 +205,8 @@ def initdInstall(): def initdUinstall(): - if not app_debug: - if mw.isAppleSystem(): - return "Apple Computer does not support" if mw.isAppleSystem(): - mw.execShell('chkconfig --del ' + getPluginName()) - initd_bin = getInitDFile() - os.remove(initd_bin) + return "Apple Computer does not support" if os.path.exists("/usr/lib/systemd/system/mongodb.service"): mw.execShell('systemctl disable mongodb') 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..6e71c4239 100755 --- a/plugins/mongodb/install.sh +++ b/plugins/mongodb/install.sh @@ -32,52 +32,179 @@ else OSNAME='unknow' fi + +SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + + + Install_app_mac() { - if [ ! -f $serverPath/source/mongodb-macos-x86_64-${VERSION}.tgz ];then wget -O $serverPath/source/mongodb-macos-x86_64-${VERSION}.tgz https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-${VERSION}.tgz fi cd $serverPath/source && tar -zxvf mongodb-macos-x86_64-${VERSION}.tgz - cd mongodb-macos-x86_64-${VERSION} && mv ./* $serverPath/mongodb } +Install_Linux_Ubuntu() +{ +##################### Ubuntu start ##################### +if [ "$SYS_VERSION_ID" == "22" ]; then + echo "Not yet supported" + exit 1 +fi + + +if [ -f /lib/systemd/system/mongod.service ];then + echo 'alreay exist!' + exit 0 +fi + +wget -qO - https://www.mongodb.org/static/pgp/server-${VERSION}.asc | sudo apt-key add - +sudo apt install gnupg +touch /etc/apt/sources.list.d/mongodb-org-${VERSION}.list +lsb_release -dc + +echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/${VERSION} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-${VERSION}.list + +apt update -y +apt install -y mongodb-org +##################### Ubuntu end ##################### +} + + +Uninstall_Linux_Ubuntu() +{ +systemctl stop mongod +apt purge -y mongodb-org* +apt autoremove -y +rm -r /var/log/mongodb +rm -r /var/lib/mongodb +} + + +Install_Linux_Debian() +{ +##################### debian start ##################### +if [ "$SYS_VERSION_ID" -ge "11" ]; then + echo "Not yet supported" + exit 1 +fi + + +if [ -f /lib/systemd/system/mongod.service ];then + echo 'alreay exist!' + exit 0 +fi + +wget -qO - https://www.mongodb.org/static/pgp/server-${VERSION}.asc | sudo apt-key add - +apt install -y gnupg +wget -qO - https://www.mongodb.org/static/pgp/server-${VERSION}.asc | sudo apt-key add - + +echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/${VERSION} main" | sudo tee /etc/apt/sources.list.d/mongodb-org-${VERSION}.list + +apt update -y +apt install -y mongodb-org + + +echo "mongodb-org hold" | sudo dpkg --set-selections +echo "mongodb-org-server hold" | sudo dpkg --set-selections +echo "mongodb-org-shell hold" | sudo dpkg --set-selections +echo "mongodb-org-mongos hold" | sudo dpkg --set-selections +echo "mongodb-org-tools hold" | sudo dpkg --set-selections + +##################### debian end ##################### +} + + + +Uninstall_Linux_Debian() +{ +systemctl stop mongod +apt purge -y mongodb-org* +apt autoremove -y +rm -r /var/log/mongodb +rm -r /var/lib/mongodb +} + + + + # 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 } Install_app() { - pip3 install pymongo - echo '正在安装脚本文件...' > $install_tmp mkdir -p $serverPath/source mkdir -p $serverPath/mongodb if [ "macos" == "$OSNAME" ];then Install_app_mac - elif [ "ubuntu" == "$OSNAME" ] || [ "debian" == "$OSNAME" ] ;then - apt install -y mongodb else Install_app_linux fi echo "${VERSION}" > $serverPath/mongodb/version.pl echo '安装完成' > $install_tmp + + #初始化 + cd ${rootPath} && python3 ${rootPath}/plugins/mongodb/index.py start + cd ${rootPath} && python3 ${rootPath}/plugins/mongodb/index.py initd_install +} + + + +Uninstall_app_linux() +{ +################## +if [ "$OSNAME" == "ubuntu" ];then + Uninstall_Linux_Ubuntu +elif [ "$OSNAME" == "debian" ];then + Unstall_Linux_Debian +elif [ "$OSNAME" == "centos" ];then + Install_Linux_CentOS +else + echo "ok" +fi +################## } Uninstall_app() { - # apt remove mongodb -y + if [ "macos" == "$OSNAME" ];then + echo 'mac' + else + Uninstall_app_linux + fi + rm -rf $serverPath/mongodb echo "Uninstall_mongodb" > $install_tmp } diff --git a/plugins/mysql/index.html b/plugins/mysql/index.html index fe590a41e..0dc255328 100755 --- a/plugins/mysql/index.html +++ b/plugins/mysql/index.html @@ -52,7 +52,10 @@ \ No newline at end of file diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index d13d6e5db..b548e4e51 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -572,7 +572,7 @@ def setMyPort(): def runInfo(): if status(version) == 'stop': - return mw.returnJson(false, 'MySQL未启动', []) + return mw.returnJson(False, 'MySQL未启动', []) db = pMysqlDb() data = db.query('show global status') @@ -1470,7 +1470,7 @@ def setDbSlave(version): def getMasterStatus(version=''): if status(version) == 'stop': - return mw.returnJson(false, 'MySQL未启动,或正在启动中...!', []) + return mw.returnJson(False, 'MySQL未启动,或正在启动中...!', []) conf = getConf() con = mw.readFile(conf) diff --git a/plugins/mysql/install.sh b/plugins/mysql/install.sh index 2f25111c9..aa36df47e 100755 --- a/plugins/mysql/install.sh +++ b/plugins/mysql/install.sh @@ -36,7 +36,7 @@ fi sh -x $curPath/versions/$2/install.sh $1 -if [ "${action}" == "install" ];then +if [ "${action}" == "install" ] && [ -d $serverPath/mysql ];then #初始化 cd ${rootPath} && python3 ${rootPath}/plugins/mysql/index.py start ${type} cd ${rootPath} && python3 ${rootPath}/plugins/mysql/index.py initd_install ${type} diff --git a/plugins/mysql/versions/5.5/install.sh b/plugins/mysql/versions/5.5/install.sh index 659912f7c..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 @@ -57,13 +57,14 @@ Install_mysql() -DDEFAULT_CHARSET=utf8mb4 \ -DDEFAULT_COLLATION=utf8mb4_general_ci \ -DCMAKE_C_COMPILER=/usr/bin/gcc \ - -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ - && make ${MAKEJN:--j2} && make install && make clean + -DCMAKE_CXX_COMPILER=/usr/bin/g++ + make clean && make && make install && make clean if [ -d $serverPath/mysql ];then echo '5.5' > $serverPath/mysql/version.pl echo '安装完成' > $install_tmp else + rm -rf ${mysqlDir}/mysql-5.5.62 echo '安装失败' > $install_tmp fi fi diff --git a/plugins/mysql/versions/5.6/install.sh b/plugins/mysql/versions/5.6/install.sh index 31f193176..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,16 +69,19 @@ Install_mysql() -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DEXTRA_CHARSETS=all \ -DDEFAULT_CHARSET=utf8mb4 \ - -DCMAKE_C_COMPILER=/usr/bin/gcc \ - -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ -DDEFAULT_COLLATION=utf8mb4_general_ci \ - && make ${MAKEJN:--j2} && make install && make clean + $OPTIONS \ + -DCMAKE_C_COMPILER=/usr/bin/gcc \ + -DCMAKE_CXX_COMPILER=/usr/bin/g++ + + make clean && make && make install && make clean if [ -d $serverPath/mysql ];then echo '5.6' > $serverPath/mysql/version.pl echo '安装完成' > $install_tmp else + rm -rf ${mysqlDir}/mysql-5.6.50 echo '安装失败' > $install_tmp fi fi diff --git a/plugins/mysql/versions/5.7/install.sh b/plugins/mysql/versions/5.7/install.sh index 76376cb9a..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,12 +85,19 @@ 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/ - make ${MAKEJN:--j2} && make install && make clean - echo '5.7' > $serverPath/mysql/version.pl - echo '安装完成' > $install_tmp + make clean && make && make install && make clean + + if [ -d $serverPath/mysql ];then + echo '5.7' > $serverPath/mysql/version.pl + echo '安装完成' > $install_tmp + else + rm -rf ${mysqlDir}/mysql-${VERSION} + echo '安装失败' > $install_tmp + fi fi } diff --git a/plugins/mysql/versions/8.0/install.sh b/plugins/mysql/versions/8.0/install.sh index 6a29558c0..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,15 +85,19 @@ 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/ - make ${MAKEJN:--j2} && make install && make clean + make clean && make && make install && make clean if [ -d $serverPath/mysql ];then echo '8.0' > $serverPath/mysql/version.pl + echo '安装完成' > $install_tmp + else + rm -rf ${mysqlDir}/mysql-8.0.25 + echo '安装失败' > $install_tmp fi - echo '安装完成' > $install_tmp fi } 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/openresty/install.sh b/plugins/openresty/install.sh index 5b597593d..ffa8670c4 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -49,6 +49,8 @@ Install_openresty() if [ -d $serverPath/openresty ];then echo "${VERSION}" > $serverPath/openresty/version.pl + + mkdir -p $serverPath/web_conf/php/conf echo "" > $serverPath/web_conf/php/conf/enable-php-00.conf #初始化 diff --git a/plugins/php/all_test.sh b/plugins/php/all_test.sh index e010a8b30..8549810fd 100644 --- a/plugins/php/all_test.sh +++ b/plugins/php/all_test.sh @@ -3,7 +3,17 @@ export PATH=$PATH:/opt/local/bin:/opt/local/sbin:/opt/local/share/man:/usr/local DIR=$(cd "$(dirname "$0")"; pwd) -PHP_VER=53 + +# cd /www/server/mdserver-web/scripts/quick && bash debug.sh +# cd /www/server/mdserver-web/plugins/php && bash all_test.sh + +# cd /www/server/mdserver-web/plugins/php/versions/52/ && bash gd.sh install 52 + +# cd /www/server/mdserver-web/plugins/php/versions/52/ && bash openssl.sh install 52 +# 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 @@ -18,124 +28,24 @@ 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/enable-php.conf b/plugins/php/conf/enable-php.conf index d9712e0e3..2046ac2cb 100644 --- a/plugins/php/conf/enable-php.conf +++ b/plugins/php/conf/enable-php.conf @@ -1,3 +1,4 @@ +set $PHP_ENV 1; location ~ [^/]\.php(/|$) { try_files $uri =404; diff --git a/plugins/php/conf/php-fpm-52.conf b/plugins/php/conf/php-fpm-52.conf index ffc418981..444c2c816 100644 --- a/plugins/php/conf/php-fpm-52.conf +++ b/plugins/php/conf/php-fpm-52.conf @@ -6,10 +6,10 @@
Pid file - /www/server/php/52/logs/php-fpm.pid + /www/server/php/52/var/run/php-fpm.pid Error log file - /www/server/php/52/logs/php-fpm.log + /www/server/php/52/var/log/php-fpm.log Log level notice @@ -107,7 +107,7 @@ 0s The log file for slow requests - logs/slow.log + var/log/www-slow.log Set open file desc rlimit 1024 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 10ab15330..ed5d3f46f 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -274,7 +274,7 @@ def phpOp(version, method): data = mw.execShell('systemctl ' + method + ' php' + version) if data[1] == '': return 'ok' - return 'fail' + return data[1] data = mw.execShell(file + ' ' + method) if data[1] == '': @@ -287,7 +287,14 @@ def start(version): def stop(version): - return phpOp(version, 'stop') + status = phpOp(version, 'stop') + + if version == '52': + file = initReplace(version) + data = mw.execShell(file + ' ' + 'stop') + if data[1] == '': + return 'ok' + return status def restart(version): @@ -445,21 +452,23 @@ def setMaxTime(version): def setMaxSize(version): args = getArgs() - if not 'max' in args: - return 'missing time args!' - max = args['max'] - if int(max) < 2: + data = checkArgs(args, ['max']) + if not data[0]: + return data[1] + + maxVal = args['max'] + if int(maxVal) < 2: return mw.returnJson(False, '上传大小限制不能小于2MB!') path = getServerDir() + '/' + version + '/etc/php.ini' conf = mw.readFile(path) rep = u"\nupload_max_filesize\s*=\s*[0-9]+M" - conf = re.sub(rep, u'\nupload_max_filesize = ' + max + 'M', conf) + conf = re.sub(rep, u'\nupload_max_filesize = ' + maxVal + 'M', conf) rep = u"\npost_max_size\s*=\s*[0-9]+M" - conf = re.sub(rep, u'\npost_max_size = ' + max + 'M', conf) + conf = re.sub(rep, u'\npost_max_size = ' + maxVal + 'M', conf) mw.writeFile(path, conf) - msg = mw.getInfo('设置PHP-{1}最大上传大小为[{2}MB]!', (version, max,)) + msg = mw.getInfo('设置PHP-{1}最大上传大小为[{2}MB]!', (version, maxVal,)) mw.writeLog('插件管理[PHP]', msg) return mw.returnJson(True, '设置成功!') @@ -555,13 +564,13 @@ def getFpmStatus(version): try: url = 'http://' + mw.getHostAddr() + '/phpfpm_status_' + version + '?json' - result = mw.httpGet(url) + result = mw.httpGet(url, 1) data = json.loads(result) fTime = time.localtime(int(data['start time'])) data['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) except Exception as e: url = 'http://127.0.0.1/phpfpm_status_' + version + '?json' - result = mw.httpGet(url) + result = mw.httpGet(url, 1) data = json.loads(result) fTime = time.localtime(int(data['start time'])) data['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime) @@ -605,20 +614,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 +638,8 @@ def getPhpinfo(v): def get_php_info(args): + if not mw.isInstalledWeb(): + return "openresty is not running!!!" return getPhpinfo(args['version']) @@ -675,9 +686,11 @@ 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) + + mw.triggerTask() return mw.returnJson(True, '已将下载任务添加到队列!') diff --git a/plugins/php/init.d/php52.tpl b/plugins/php/init.d/php52.tpl index 2daa4a78d..73f96406b 100644 --- a/plugins/php/init.d/php52.tpl +++ b/plugins/php/init.d/php52.tpl @@ -2,7 +2,7 @@ php_fpm_BIN=/www/server/php/52/bin/php-cgi php_fpm_CONF=/www/server/php/52/etc/php-fpm.conf -php_fpm_PID=/www/server/php/52/logs/php-fpm.pid +php_fpm_PID=/www/server/php/52/var/run/php-fpm.pid php_opts="--fpm-config $php_fpm_CONF" diff --git a/plugins/php/install.sh b/plugins/php/install.sh index b3a6f2f95..9393f0e31 100755 --- a/plugins/php/install.sh +++ b/plugins/php/install.sh @@ -43,7 +43,7 @@ fi cd ${curPath} && sh -x $curPath/versions/$2/install.sh $1 -if [ "${action}" == "install" ];then +if [ "${action}" == "install" ] && [ -d ${serverPath}/php/${type} ];then #初始化 cd ${rootPath} && python3 ${rootPath}/plugins/php/index.py start ${type} cd ${rootPath} && python3 ${rootPath}/plugins/php/index.py initd_install ${type} 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/lib/openssl_10.sh b/plugins/php/lib/openssl_10.sh new file mode 100644 index 000000000..90c1155e3 --- /dev/null +++ b/plugins/php/lib/openssl_10.sh @@ -0,0 +1,27 @@ +#!/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}/openssl10 ];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}/openssl10 zlib-dynamic shared + make && make install +fi + + diff --git a/plugins/php/versions/52/eaccelerator.sh b/plugins/php/versions/52/eaccelerator.sh index 06ef44f52..bd50e9d95 100755 --- a/plugins/php/versions/52/eaccelerator.sh +++ b/plugins/php/versions/52/eaccelerator.sh @@ -77,7 +77,8 @@ Install_lib() echo "${LIBNAME}.allowed_admin_path=/www/wwwroot/you_project_dir" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -100,7 +101,8 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/52/exif.sh b/plugins/php/versions/52/exif.sh index f52c194c5..bd2120f7a 100755 --- a/plugins/php/versions/52/exif.sh +++ b/plugins/php/versions/52/exif.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,8 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/52/gd.sh b/plugins/php/versions/52/gd.sh index 4a05b6046..56564ca6a 100755 --- a/plugins/php/versions/52/gd.sh +++ b/plugins/php/versions/52/gd.sh @@ -27,6 +27,26 @@ else BAK='' fi + +sysName=`uname` +echo "use system: ${sysName}" + +if [ ${sysName} == "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 "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_lib() { @@ -36,9 +56,12 @@ Install_lib() return fi - ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so - ln -s /usr/lib64/libpng.so /usr/lib/ - cp -frp /usr/lib64/libldap* /usr/lib/ + + if [ "$OSNAME" == "debian" ] && [ "$OSNAME" == "ubuntu" ];then + ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so + ln -s /usr/lib64/libpng.so /usr/lib/ + cp -frp /usr/lib64/libldap* /usr/lib/ + fi if [ ! -f "$extFile" ];then @@ -54,8 +77,7 @@ Install_lib() --with-gd \ --with-jpeg-dir=/usr/lib \ --with-freetype-dir=${serverPath}/lib/freetype_old \ - --enable-gd-native-ttf \ - --enable-gd-jis-conv + --enable-gd-native-ttf make clean && make && make install && make clean @@ -70,7 +92,7 @@ Install_lib() echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php${version} restart + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -93,7 +115,8 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/52/install.sh b/plugins/php/versions/52/install.sh index c130e43e9..ad227d789 100755 --- a/plugins/php/versions/52/install.sh +++ b/plugins/php/versions/52/install.sh @@ -161,6 +161,13 @@ if [ ! -d $serverPath/php/${PHP_VER}/lib/php/extensions/no-debug-non-zts-2006061 mkdir -p $serverPath/php/${PHP_VER}/lib/php/extensions/no-debug-non-zts-20060613 fi +# ps -ef|grep php/52 |grep -v grep |awk '{print $2}'|xargs kill +# /www/server/php/init.d/php52 start +# /www/server/php/52/sbin/php-fpm start +# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 52 +mkdir -p $serverPath/php/${PHP_VER}/var/log +mkdir -p $serverPath/php/${PHP_VER}/var/run + #------------------------ install end ------------------------------------# } diff --git a/plugins/php/versions/52/intl.sh b/plugins/php/versions/52/intl.sh index d45267fd6..156677458 100755 --- a/plugins/php/versions/52/intl.sh +++ b/plugins/php/versions/52/intl.sh @@ -35,19 +35,21 @@ Install_lib() return fi - + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash icu.sh + if [ ! -f "$extFile" ];then php_lib=$sourcePath/php_lib mkdir -p $php_lib - + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz cd ${LIBNAME}-${LIBV} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config - make && make install && make clean + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --with-icu-dir=${serverPath}/lib/icu + make clean && make && make install && make clean fi @@ -60,7 +62,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +85,8 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/52/ioncube.sh b/plugins/php/versions/52/ioncube.sh new file mode 100755 index 000000000..40a8f5810 --- /dev/null +++ b/plugins/php/versions/52/ioncube.sh @@ -0,0 +1,97 @@ +#!/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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/52/memcache.sh b/plugins/php/versions/52/memcache.sh index 8a465313d..d5f77addd 100755 --- a/plugins/php/versions/52/memcache.sh +++ b/plugins/php/versions/52/memcache.sh @@ -58,7 +58,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -81,7 +81,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/52/openssl.sh b/plugins/php/versions/52/openssl.sh new file mode 100755 index 000000000..f36f459d7 --- /dev/null +++ b/plugins/php/versions/52/openssl.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` + +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_10.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/openssl10/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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/52/pcntl.sh b/plugins/php/versions/52/pcntl.sh index 4a458ef2a..d0e628ec4 100755 --- a/plugins/php/versions/52/pcntl.sh +++ b/plugins/php/versions/52/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,8 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/52/redis.sh b/plugins/php/versions/52/redis.sh index 8aa23aee9..df5e93651 100755 --- a/plugins/php/versions/52/redis.sh +++ b/plugins/php/versions/52/redis.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -85,7 +85,8 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/52/xhprof.sh b/plugins/php/versions/52/xhprof.sh index 7ee22f604..c80b5dbe2 100755 --- a/plugins/php/versions/52/xhprof.sh +++ b/plugins/php/versions/52/xhprof.sh @@ -66,7 +66,7 @@ Install_lib() echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/52/zendoptimizer.sh b/plugins/php/versions/52/zendoptimizer.sh index 5e11bcb53..338c8923f 100755 --- a/plugins/php/versions/52/zendoptimizer.sh +++ b/plugins/php/versions/52/zendoptimizer.sh @@ -67,7 +67,7 @@ Install_lib() echo "zend_loader.obfuscation_level_support=3" >> $serverPath/php/$version/etc/php.ini echo "zend_loader.license_path=" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/\[Zend ZendGuard Loader\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/apc.sh b/plugins/php/versions/53/apc.sh index 9db484777..0bff3a54a 100755 --- a/plugins/php/versions/53/apc.sh +++ b/plugins/php/versions/53/apc.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -85,7 +85,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/eaccelerator.sh b/plugins/php/versions/53/eaccelerator.sh index 42db42fdf..d8df39bb6 100755 --- a/plugins/php/versions/53/eaccelerator.sh +++ b/plugins/php/versions/53/eaccelerator.sh @@ -67,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/exif.sh b/plugins/php/versions/53/exif.sh new file mode 100755 index 000000000..7f02ce13b --- /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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/53/fileinfo.sh b/plugins/php/versions/53/fileinfo.sh index 6966d6aaa..042a24f54 100755 --- a/plugins/php/versions/53/fileinfo.sh +++ b/plugins/php/versions/53/fileinfo.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,9 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh index c67009431..aad347ab3 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -53,7 +53,7 @@ else fi -if [ ! -d $serverPath/php/53 ];then +if [ ! -d $serverPath/php/53/bin ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/53 \ --exec-prefix=$serverPath/php/53 \ @@ -99,7 +99,7 @@ if [ -f $serverPath/php/53/sbin/php-fpm.dSYM ];then fi -if [ ! -d $serverPath/php/53/lib/php/extensions/no-debug-non-zts-20090626 ]; then +if [ -d $serverPath/php/53 ] && [ ! -d $serverPath/php/53/lib/php/extensions/no-debug-non-zts-20090626 ]; then mkdir -p $serverPath/php/53/lib/php/extensions/no-debug-non-zts-20090626 fi diff --git a/plugins/php/versions/53/intl.sh b/plugins/php/versions/53/intl.sh index 2e5c53f88..2279d47cc 100755 --- a/plugins/php/versions/53/intl.sh +++ b/plugins/php/versions/53/intl.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/ioncube.sh b/plugins/php/versions/53/ioncube.sh new file mode 100755 index 000000000..ef5440382 --- /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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/53/memcache.sh b/plugins/php/versions/53/memcache.sh index f9869ae91..c212170a8 100755 --- a/plugins/php/versions/53/memcache.sh +++ b/plugins/php/versions/53/memcache.sh @@ -57,7 +57,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -80,7 +80,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/memcached.sh b/plugins/php/versions/53/memcached.sh index ef3afa830..984f03d24 100755 --- a/plugins/php/versions/53/memcached.sh +++ b/plugins/php/versions/53/memcached.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/mongo.sh b/plugins/php/versions/53/mongo.sh index 6902cf15f..03cb90e53 100755 --- a/plugins/php/versions/53/mongo.sh +++ b/plugins/php/versions/53/mongo.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,8 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/opcache.sh b/plugins/php/versions/53/opcache.sh index e72eeef9e..f849d9285 100755 --- a/plugins/php/versions/53/opcache.sh +++ b/plugins/php/versions/53/opcache.sh @@ -72,7 +72,7 @@ Install_lib() echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -96,7 +96,7 @@ Uninstall_lib() rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/openssl.sh b/plugins/php/versions/53/openssl.sh new file mode 100755 index 000000000..4e353d132 --- /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_10.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/openssl10/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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/53/pcntl.sh b/plugins/php/versions/53/pcntl.sh index 4a458ef2a..796b84897 100755 --- a/plugins/php/versions/53/pcntl.sh +++ b/plugins/php/versions/53/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/redis.sh b/plugins/php/versions/53/redis.sh index 8539cbcfe..d3e0ab9ae 100755 --- a/plugins/php/versions/53/redis.sh +++ b/plugins/php/versions/53/redis.sh @@ -62,7 +62,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/seaslog.sh b/plugins/php/versions/53/seaslog.sh index bb5d03010..0c5c01176 100755 --- a/plugins/php/versions/53/seaslog.sh +++ b/plugins/php/versions/53/seaslog.sh @@ -69,7 +69,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -93,7 +93,7 @@ Uninstall_lib() sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/solr.sh b/plugins/php/versions/53/solr.sh index a748eee86..930a48cd8 100755 --- a/plugins/php/versions/53/solr.sh +++ b/plugins/php/versions/53/solr.sh @@ -67,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/swoole.sh b/plugins/php/versions/53/swoole.sh index c561bfb75..e7d9ca249 100755 --- a/plugins/php/versions/53/swoole.sh +++ b/plugins/php/versions/53/swoole.sh @@ -79,7 +79,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -103,7 +103,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/xdebug.sh b/plugins/php/versions/53/xdebug.sh index aa1ae0d1c..34c0b80a1 100755 --- a/plugins/php/versions/53/xdebug.sh +++ b/plugins/php/versions/53/xdebug.sh @@ -60,9 +60,9 @@ 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -85,7 +85,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/xhprof.sh b/plugins/php/versions/53/xhprof.sh index 7ee22f604..c80b5dbe2 100755 --- a/plugins/php/versions/53/xhprof.sh +++ b/plugins/php/versions/53/xhprof.sh @@ -66,7 +66,7 @@ Install_lib() echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/yaf.sh b/plugins/php/versions/53/yaf.sh index b11323744..f65771c44 100755 --- a/plugins/php/versions/53/yaf.sh +++ b/plugins/php/versions/53/yaf.sh @@ -67,7 +67,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "yaf.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -92,7 +92,7 @@ Uninstall_lib() sed -i $BAK "/\[yaf\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/yar.sh b/plugins/php/versions/53/yar.sh index 49851c47a..505954e24 100755 --- a/plugins/php/versions/53/yar.sh +++ b/plugins/php/versions/53/yar.sh @@ -69,7 +69,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -94,7 +94,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/53/zendguardloader.sh b/plugins/php/versions/53/zendguardloader.sh index f86c82c57..8670e1296 100755 --- a/plugins/php/versions/53/zendguardloader.sh +++ b/plugins/php/versions/53/zendguardloader.sh @@ -66,7 +66,7 @@ Install_lib() echo "zend_loader.obfuscation_level_support=3" >> $serverPath/php/$version/etc/php.ini echo "zend_loader.license_path=" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/\[Zend ZendGuard Loader\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/apc.sh b/plugins/php/versions/54/apc.sh index 1c04d366a..156e46a98 100755 --- a/plugins/php/versions/54/apc.sh +++ b/plugins/php/versions/54/apc.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/exif.sh b/plugins/php/versions/54/exif.sh index f52c194c5..bd2120f7a 100755 --- a/plugins/php/versions/54/exif.sh +++ b/plugins/php/versions/54/exif.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,8 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/fileinfo.sh b/plugins/php/versions/54/fileinfo.sh index 6966d6aaa..193f44b2e 100755 --- a/plugins/php/versions/54/fileinfo.sh +++ b/plugins/php/versions/54/fileinfo.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/imagemagick.sh b/plugins/php/versions/54/imagemagick.sh index 2ecfc7e92..da023947c 100755 --- a/plugins/php/versions/54/imagemagick.sh +++ b/plugins/php/versions/54/imagemagick.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/intl.sh b/plugins/php/versions/54/intl.sh index a0374a4f0..480e003ba 100755 --- a/plugins/php/versions/54/intl.sh +++ b/plugins/php/versions/54/intl.sh @@ -64,7 +64,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -87,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/ioncube.sh b/plugins/php/versions/54/ioncube.sh new file mode 100755 index 000000000..ef5440382 --- /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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/54/memcache.sh b/plugins/php/versions/54/memcache.sh index 20727b72d..1f9410b79 100755 --- a/plugins/php/versions/54/memcache.sh +++ b/plugins/php/versions/54/memcache.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/memcached.sh b/plugins/php/versions/54/memcached.sh index f353ec37c..07ddb8ba0 100755 --- a/plugins/php/versions/54/memcached.sh +++ b/plugins/php/versions/54/memcached.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/mongo.sh b/plugins/php/versions/54/mongo.sh index 236822dfd..dba6f254f 100755 --- a/plugins/php/versions/54/mongo.sh +++ b/plugins/php/versions/54/mongo.sh @@ -67,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/opcache.sh b/plugins/php/versions/54/opcache.sh index 125edecf8..901d90422 100755 --- a/plugins/php/versions/54/opcache.sh +++ b/plugins/php/versions/54/opcache.sh @@ -71,7 +71,7 @@ Install_lib() echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -95,7 +95,7 @@ Uninstall_lib() rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/openssl.sh b/plugins/php/versions/54/openssl.sh new file mode 100755 index 000000000..4e353d132 --- /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_10.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/openssl10/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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/54/pcntl.sh b/plugins/php/versions/54/pcntl.sh index 4a458ef2a..796b84897 100755 --- a/plugins/php/versions/54/pcntl.sh +++ b/plugins/php/versions/54/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/redis.sh b/plugins/php/versions/54/redis.sh index 34821d450..565e18c21 100755 --- a/plugins/php/versions/54/redis.sh +++ b/plugins/php/versions/54/redis.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/seaslog.sh b/plugins/php/versions/54/seaslog.sh index 039f8497e..8ec22536d 100755 --- a/plugins/php/versions/54/seaslog.sh +++ b/plugins/php/versions/54/seaslog.sh @@ -69,7 +69,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -93,7 +93,7 @@ Uninstall_lib() sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/solr.sh b/plugins/php/versions/54/solr.sh index df91c3dad..e8cbd5f88 100755 --- a/plugins/php/versions/54/solr.sh +++ b/plugins/php/versions/54/solr.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/swoole.sh b/plugins/php/versions/54/swoole.sh index 5ccbe3d13..f0af7ff2f 100755 --- a/plugins/php/versions/54/swoole.sh +++ b/plugins/php/versions/54/swoole.sh @@ -76,7 +76,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -99,7 +99,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/xdebug.sh b/plugins/php/versions/54/xdebug.sh index 7aaf482e3..0fda414d9 100755 --- a/plugins/php/versions/54/xdebug.sh +++ b/plugins/php/versions/54/xdebug.sh @@ -57,9 +57,9 @@ 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/xhprof.sh b/plugins/php/versions/54/xhprof.sh index 6a82bced9..5738efb1d 100755 --- a/plugins/php/versions/54/xhprof.sh +++ b/plugins/php/versions/54/xhprof.sh @@ -64,7 +64,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/yaf.sh b/plugins/php/versions/54/yaf.sh index a34398c74..5140d10e9 100755 --- a/plugins/php/versions/54/yaf.sh +++ b/plugins/php/versions/54/yaf.sh @@ -69,7 +69,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -93,7 +93,7 @@ Uninstall_lib() sed -i '_bak' "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/yar.sh b/plugins/php/versions/54/yar.sh index 853b1817d..a8be8e9f6 100755 --- a/plugins/php/versions/54/yar.sh +++ b/plugins/php/versions/54/yar.sh @@ -71,7 +71,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -96,7 +96,7 @@ Uninstall_lib() sed -i '_bak' "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/54/zendguardloader.sh b/plugins/php/versions/54/zendguardloader.sh index 11a00e57e..dff1474dd 100755 --- a/plugins/php/versions/54/zendguardloader.sh +++ b/plugins/php/versions/54/zendguardloader.sh @@ -57,7 +57,7 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo -e "[Zend ZendGuard Loader]\nzend_extension=ZendGuardLoader.so\nzend_loader.enable=1\nzend_loader.disable_licensing=0\nzend_loader.obfuscation_level_support=3\nzend_loader.license_path=" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -81,7 +81,7 @@ Uninstall_lib() sed -i $BAK '/\[Zend ZendGuard Loader\]/d' $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/exif.sh b/plugins/php/versions/55/exif.sh index f52c194c5..7f02ce13b 100755 --- a/plugins/php/versions/55/exif.sh +++ b/plugins/php/versions/55/exif.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/fileinfo.sh b/plugins/php/versions/55/fileinfo.sh index 6966d6aaa..193f44b2e 100755 --- a/plugins/php/versions/55/fileinfo.sh +++ b/plugins/php/versions/55/fileinfo.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/imagemagick.sh b/plugins/php/versions/55/imagemagick.sh index 2ecfc7e92..da023947c 100755 --- a/plugins/php/versions/55/imagemagick.sh +++ b/plugins/php/versions/55/imagemagick.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/intl.sh b/plugins/php/versions/55/intl.sh index a0374a4f0..480e003ba 100755 --- a/plugins/php/versions/55/intl.sh +++ b/plugins/php/versions/55/intl.sh @@ -64,7 +64,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -87,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/ioncube.sh b/plugins/php/versions/55/ioncube.sh new file mode 100755 index 000000000..ef5440382 --- /dev/null +++ b/plugins/php/versions/55/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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/55/memcache.sh b/plugins/php/versions/55/memcache.sh index d7f88dcde..9a40e291a 100755 --- a/plugins/php/versions/55/memcache.sh +++ b/plugins/php/versions/55/memcache.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/memcached.sh b/plugins/php/versions/55/memcached.sh index e04597bfc..5113c6b34 100755 --- a/plugins/php/versions/55/memcached.sh +++ b/plugins/php/versions/55/memcached.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/mongo.sh b/plugins/php/versions/55/mongo.sh index e06cccd04..798f24867 100755 --- a/plugins/php/versions/55/mongo.sh +++ b/plugins/php/versions/55/mongo.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/mongodb.sh b/plugins/php/versions/55/mongodb.sh index 7147a7d28..10da08429 100755 --- a/plugins/php/versions/55/mongodb.sh +++ b/plugins/php/versions/55/mongodb.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/opcache.sh b/plugins/php/versions/55/opcache.sh index bf85a54e0..500a12334 100755 --- a/plugins/php/versions/55/opcache.sh +++ b/plugins/php/versions/55/opcache.sh @@ -45,7 +45,7 @@ Install_lib() echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -56,7 +56,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/openssl.sh b/plugins/php/versions/55/openssl.sh new file mode 100755 index 000000000..4e353d132 --- /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_10.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/openssl10/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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/55/pcntl.sh b/plugins/php/versions/55/pcntl.sh index 4a458ef2a..796b84897 100755 --- a/plugins/php/versions/55/pcntl.sh +++ b/plugins/php/versions/55/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/redis.sh b/plugins/php/versions/55/redis.sh index 53be55e29..b82d6bc8a 100755 --- a/plugins/php/versions/55/redis.sh +++ b/plugins/php/versions/55/redis.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/seaslog.sh b/plugins/php/versions/55/seaslog.sh index 3cde227ef..7add41d9d 100755 --- a/plugins/php/versions/55/seaslog.sh +++ b/plugins/php/versions/55/seaslog.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -92,7 +92,7 @@ Uninstall_lib() sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/solr.sh b/plugins/php/versions/55/solr.sh index a0acfcd84..8279e12fe 100755 --- a/plugins/php/versions/55/solr.sh +++ b/plugins/php/versions/55/solr.sh @@ -67,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/swoole.sh b/plugins/php/versions/55/swoole.sh index 94f34d62b..999124ef3 100755 --- a/plugins/php/versions/55/swoole.sh +++ b/plugins/php/versions/55/swoole.sh @@ -75,7 +75,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -98,7 +98,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/xdebug.sh b/plugins/php/versions/55/xdebug.sh index b57ee4885..846b921db 100755 --- a/plugins/php/versions/55/xdebug.sh +++ b/plugins/php/versions/55/xdebug.sh @@ -61,9 +61,9 @@ 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK '/${LIBNAME}/d' $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/xhprof.sh b/plugins/php/versions/55/xhprof.sh index 0efd5765a..9f6fec1d5 100755 --- a/plugins/php/versions/55/xhprof.sh +++ b/plugins/php/versions/55/xhprof.sh @@ -67,7 +67,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/yaf.sh b/plugins/php/versions/55/yaf.sh index 6ed74e16f..63c32817a 100755 --- a/plugins/php/versions/55/yaf.sh +++ b/plugins/php/versions/55/yaf.sh @@ -69,7 +69,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "yaf.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -93,7 +93,7 @@ Uninstall_lib() sed -i $BAK "/\[yaf\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/55/yar.sh b/plugins/php/versions/55/yar.sh index 7d6d99565..620c105b4 100755 --- a/plugins/php/versions/55/yar.sh +++ b/plugins/php/versions/55/yar.sh @@ -72,7 +72,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -97,7 +97,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/exif.sh b/plugins/php/versions/56/exif.sh index f52c194c5..7f02ce13b 100755 --- a/plugins/php/versions/56/exif.sh +++ b/plugins/php/versions/56/exif.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/fileinfo.sh b/plugins/php/versions/56/fileinfo.sh index 6966d6aaa..193f44b2e 100755 --- a/plugins/php/versions/56/fileinfo.sh +++ b/plugins/php/versions/56/fileinfo.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/imagemagick.sh b/plugins/php/versions/56/imagemagick.sh index 2ecfc7e92..da023947c 100755 --- a/plugins/php/versions/56/imagemagick.sh +++ b/plugins/php/versions/56/imagemagick.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/intl.sh b/plugins/php/versions/56/intl.sh index a0374a4f0..480e003ba 100755 --- a/plugins/php/versions/56/intl.sh +++ b/plugins/php/versions/56/intl.sh @@ -64,7 +64,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -87,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/ioncube.sh b/plugins/php/versions/56/ioncube.sh new file mode 100755 index 000000000..ef5440382 --- /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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/56/memcache.sh b/plugins/php/versions/56/memcache.sh index d7f88dcde..9a40e291a 100755 --- a/plugins/php/versions/56/memcache.sh +++ b/plugins/php/versions/56/memcache.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/memcached.sh b/plugins/php/versions/56/memcached.sh index 23a8b2c19..85405d907 100755 --- a/plugins/php/versions/56/memcached.sh +++ b/plugins/php/versions/56/memcached.sh @@ -64,7 +64,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -87,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/mongo.sh b/plugins/php/versions/56/mongo.sh index 4ca876300..8ff77f0c8 100755 --- a/plugins/php/versions/56/mongo.sh +++ b/plugins/php/versions/56/mongo.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/mongodb.sh b/plugins/php/versions/56/mongodb.sh index ef60a8600..bce5ea932 100755 --- a/plugins/php/versions/56/mongodb.sh +++ b/plugins/php/versions/56/mongodb.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/opcache.sh b/plugins/php/versions/56/opcache.sh index 0380d8c90..a4227c20e 100755 --- a/plugins/php/versions/56/opcache.sh +++ b/plugins/php/versions/56/opcache.sh @@ -44,7 +44,7 @@ Install_lib() echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -55,7 +55,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/openssl.sh b/plugins/php/versions/56/openssl.sh index d93233b72..4e353d132 100755 --- a/plugins/php/versions/56/openssl.sh +++ b/plugins/php/versions/56/openssl.sh @@ -36,25 +36,38 @@ Install_lib() return fi + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash openssl_10.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/openssl10/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 - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -77,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/pcntl.sh b/plugins/php/versions/56/pcntl.sh index 4a458ef2a..796b84897 100755 --- a/plugins/php/versions/56/pcntl.sh +++ b/plugins/php/versions/56/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/redis.sh b/plugins/php/versions/56/redis.sh index 18952c19d..252c7e942 100755 --- a/plugins/php/versions/56/redis.sh +++ b/plugins/php/versions/56/redis.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/seaslog.sh b/plugins/php/versions/56/seaslog.sh index f50fffecd..190e266e4 100755 --- a/plugins/php/versions/56/seaslog.sh +++ b/plugins/php/versions/56/seaslog.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/solr.sh b/plugins/php/versions/56/solr.sh index 8e9382ff5..5a1d3b159 100755 --- a/plugins/php/versions/56/solr.sh +++ b/plugins/php/versions/56/solr.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/swoole.sh b/plugins/php/versions/56/swoole.sh index 4d9bf30e9..cb3907c1d 100755 --- a/plugins/php/versions/56/swoole.sh +++ b/plugins/php/versions/56/swoole.sh @@ -77,7 +77,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -100,7 +100,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/xdebug.sh b/plugins/php/versions/56/xdebug.sh index 5a1c06c54..681ee3495 100755 --- a/plugins/php/versions/56/xdebug.sh +++ b/plugins/php/versions/56/xdebug.sh @@ -59,9 +59,9 @@ 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/xhprof.sh b/plugins/php/versions/56/xhprof.sh index 928ea569e..43c9fac63 100755 --- a/plugins/php/versions/56/xhprof.sh +++ b/plugins/php/versions/56/xhprof.sh @@ -67,7 +67,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/yaf.sh b/plugins/php/versions/56/yaf.sh index 7ef1f7715..87f953439 100755 --- a/plugins/php/versions/56/yaf.sh +++ b/plugins/php/versions/56/yaf.sh @@ -56,7 +56,7 @@ Install_lib() echo -e "[yaf]\nextension=yaf.so\nyaf.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -81,7 +81,7 @@ Uninstall_lib() sed -i $BAK '/\[yaf\]/d' $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/yar.sh b/plugins/php/versions/56/yar.sh index 911563896..202208c33 100755 --- a/plugins/php/versions/56/yar.sh +++ b/plugins/php/versions/56/yar.sh @@ -69,7 +69,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -94,7 +94,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/56/zendguardloader.sh b/plugins/php/versions/56/zendguardloader.sh index c746acd9f..431b5ef75 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 @@ -57,7 +58,7 @@ Install_lib() echo -e "[Zend ZendGuard Loader]\nzend_extension=ZendGuardLoader.so\nzend_loader.enable=1\nzend_loader.disable_licensing=0\nzend_loader.obfuscation_level_support=3\nzend_loader.license_path=" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -81,7 +82,7 @@ Uninstall_lib() sed -i $BAK '/\[Zend ZendGuard Loader\]/d' $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/exif.sh b/plugins/php/versions/70/exif.sh index f52c194c5..7f02ce13b 100755 --- a/plugins/php/versions/70/exif.sh +++ b/plugins/php/versions/70/exif.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/fileinfo.sh b/plugins/php/versions/70/fileinfo.sh index 6966d6aaa..193f44b2e 100755 --- a/plugins/php/versions/70/fileinfo.sh +++ b/plugins/php/versions/70/fileinfo.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/imagemagick.sh b/plugins/php/versions/70/imagemagick.sh index fde729fad..6c9688423 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 @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/intl.sh b/plugins/php/versions/70/intl.sh index a0374a4f0..480e003ba 100755 --- a/plugins/php/versions/70/intl.sh +++ b/plugins/php/versions/70/intl.sh @@ -64,7 +64,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -87,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/ioncube.sh b/plugins/php/versions/70/ioncube.sh new file mode 100755 index 000000000..ef5440382 --- /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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/70/memcached.sh b/plugins/php/versions/70/memcached.sh index 83b8315e8..264d9dbcd 100755 --- a/plugins/php/versions/70/memcached.sh +++ b/plugins/php/versions/70/memcached.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/mongodb.sh b/plugins/php/versions/70/mongodb.sh index 870b4aeeb..cfb2e8c11 100755 --- a/plugins/php/versions/70/mongodb.sh +++ b/plugins/php/versions/70/mongodb.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/opcache.sh b/plugins/php/versions/70/opcache.sh index 2d3b4a759..0547b1b76 100755 --- a/plugins/php/versions/70/opcache.sh +++ b/plugins/php/versions/70/opcache.sh @@ -44,7 +44,7 @@ Install_lib() echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -55,7 +55,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/openssl.sh b/plugins/php/versions/70/openssl.sh new file mode 100755 index 000000000..bdd1323e5 --- /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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/70/pcntl.sh b/plugins/php/versions/70/pcntl.sh index 4a458ef2a..796b84897 100755 --- a/plugins/php/versions/70/pcntl.sh +++ b/plugins/php/versions/70/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/redis.sh b/plugins/php/versions/70/redis.sh index d9ef39853..2afdbe684 100755 --- a/plugins/php/versions/70/redis.sh +++ b/plugins/php/versions/70/redis.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/seaslog.sh b/plugins/php/versions/70/seaslog.sh index 84aa5d6e4..aa04d92d2 100755 --- a/plugins/php/versions/70/seaslog.sh +++ b/plugins/php/versions/70/seaslog.sh @@ -67,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/solr.sh b/plugins/php/versions/70/solr.sh index 2c9172224..9d34a2760 100755 --- a/plugins/php/versions/70/solr.sh +++ b/plugins/php/versions/70/solr.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/swoole.sh b/plugins/php/versions/70/swoole.sh index 5de04a617..7a197da2b 100755 --- a/plugins/php/versions/70/swoole.sh +++ b/plugins/php/versions/70/swoole.sh @@ -75,7 +75,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -98,7 +98,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/xdebug.sh b/plugins/php/versions/70/xdebug.sh index 98de7fdcf..ea188200b 100755 --- a/plugins/php/versions/70/xdebug.sh +++ b/plugins/php/versions/70/xdebug.sh @@ -58,9 +58,9 @@ 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/xhprof.sh b/plugins/php/versions/70/xhprof.sh index 759081253..6c0f5eeb4 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 @@ -66,7 +66,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/yac.sh b/plugins/php/versions/70/yac.sh index 46292d91d..3ff9d3bff 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 @@ -64,7 +64,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/yaf.sh b/plugins/php/versions/70/yaf.sh index c82c102a0..b5713edeb 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 @@ -64,7 +64,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/yar.sh b/plugins/php/versions/70/yar.sh index 336050648..f75185834 100755 --- a/plugins/php/versions/70/yar.sh +++ b/plugins/php/versions/70/yar.sh @@ -68,7 +68,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -93,7 +93,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/zip.sh b/plugins/php/versions/70/zip.sh index ab58ab823..4606559ba 100755 --- a/plugins/php/versions/70/zip.sh +++ b/plugins/php/versions/70/zip.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/70/zlib.sh b/plugins/php/versions/70/zlib.sh index 030733cb3..becdb182d 100755 --- a/plugins/php/versions/70/zlib.sh +++ b/plugins/php/versions/70/zlib.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/exif.sh b/plugins/php/versions/71/exif.sh index f52c194c5..7f02ce13b 100755 --- a/plugins/php/versions/71/exif.sh +++ b/plugins/php/versions/71/exif.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/fileinfo.sh b/plugins/php/versions/71/fileinfo.sh index 6966d6aaa..193f44b2e 100755 --- a/plugins/php/versions/71/fileinfo.sh +++ b/plugins/php/versions/71/fileinfo.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/imagemagick.sh b/plugins/php/versions/71/imagemagick.sh index fde729fad..6c9688423 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 @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/intl.sh b/plugins/php/versions/71/intl.sh index c58d8741c..480e003ba 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 @@ -61,7 +64,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/ioncube.sh b/plugins/php/versions/71/ioncube.sh new file mode 100755 index 000000000..ef5440382 --- /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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/71/mcrypt.sh b/plugins/php/versions/71/mcrypt.sh index 73a1fcbf9..93a5b4aa7 100755 --- a/plugins/php/versions/71/mcrypt.sh +++ b/plugins/php/versions/71/mcrypt.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/memcached.sh b/plugins/php/versions/71/memcached.sh index ecd1ee770..cd31d0110 100755 --- a/plugins/php/versions/71/memcached.sh +++ b/plugins/php/versions/71/memcached.sh @@ -62,7 +62,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -85,7 +85,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/mongodb.sh b/plugins/php/versions/71/mongodb.sh index b66a44b96..ec61dcc33 100755 --- a/plugins/php/versions/71/mongodb.sh +++ b/plugins/php/versions/71/mongodb.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/opcache.sh b/plugins/php/versions/71/opcache.sh index 0380d8c90..a4227c20e 100755 --- a/plugins/php/versions/71/opcache.sh +++ b/plugins/php/versions/71/opcache.sh @@ -44,7 +44,7 @@ Install_lib() echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -55,7 +55,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/openssl.sh b/plugins/php/versions/71/openssl.sh index 165e01bd2..bdd1323e5 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 @@ -63,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/pcntl.sh b/plugins/php/versions/71/pcntl.sh index 4a458ef2a..796b84897 100755 --- a/plugins/php/versions/71/pcntl.sh +++ b/plugins/php/versions/71/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/redis.sh b/plugins/php/versions/71/redis.sh index d9a188a7d..17485ef91 100755 --- a/plugins/php/versions/71/redis.sh +++ b/plugins/php/versions/71/redis.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/seaslog.sh b/plugins/php/versions/71/seaslog.sh index 7e6671abd..4ce5de4b2 100755 --- a/plugins/php/versions/71/seaslog.sh +++ b/plugins/php/versions/71/seaslog.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -92,7 +92,7 @@ Uninstall_lib() sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/solr.sh b/plugins/php/versions/71/solr.sh index f24d1cebf..3acb559de 100755 --- a/plugins/php/versions/71/solr.sh +++ b/plugins/php/versions/71/solr.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/swoole.sh b/plugins/php/versions/71/swoole.sh index fc44a2b07..94a409fcd 100755 --- a/plugins/php/versions/71/swoole.sh +++ b/plugins/php/versions/71/swoole.sh @@ -73,7 +73,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -96,7 +96,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/xdebug.sh b/plugins/php/versions/71/xdebug.sh index 0c9fa0c18..267a79d80 100755 --- a/plugins/php/versions/71/xdebug.sh +++ b/plugins/php/versions/71/xdebug.sh @@ -57,9 +57,9 @@ 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK '/${LIBNAME}/d' $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/xhprof.sh b/plugins/php/versions/71/xhprof.sh index bd684f2ed..f56547b75 100755 --- a/plugins/php/versions/71/xhprof.sh +++ b/plugins/php/versions/71/xhprof.sh @@ -67,7 +67,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/yac.sh b/plugins/php/versions/71/yac.sh index 9107616af..d3001a111 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 @@ -67,7 +67,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/yaf.sh b/plugins/php/versions/71/yaf.sh index f5d2c9a88..d0425d0bc 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 @@ -63,7 +63,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -87,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/yar.sh b/plugins/php/versions/71/yar.sh index 04e912a30..21ccf3142 100755 --- a/plugins/php/versions/71/yar.sh +++ b/plugins/php/versions/71/yar.sh @@ -71,7 +71,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -96,7 +96,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/zip.sh b/plugins/php/versions/71/zip.sh index ab58ab823..4606559ba 100755 --- a/plugins/php/versions/71/zip.sh +++ b/plugins/php/versions/71/zip.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/71/zlib.sh b/plugins/php/versions/71/zlib.sh index 030733cb3..becdb182d 100755 --- a/plugins/php/versions/71/zlib.sh +++ b/plugins/php/versions/71/zlib.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/exif.sh b/plugins/php/versions/72/exif.sh index f52c194c5..7f02ce13b 100755 --- a/plugins/php/versions/72/exif.sh +++ b/plugins/php/versions/72/exif.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/fileinfo.sh b/plugins/php/versions/72/fileinfo.sh index 6966d6aaa..193f44b2e 100755 --- a/plugins/php/versions/72/fileinfo.sh +++ b/plugins/php/versions/72/fileinfo.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/imagemagick.sh b/plugins/php/versions/72/imagemagick.sh index fde729fad..6c9688423 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 @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/intl.sh b/plugins/php/versions/72/intl.sh index c58d8741c..480e003ba 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 @@ -61,7 +64,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/ioncube.sh b/plugins/php/versions/72/ioncube.sh new file mode 100755 index 000000000..ef5440382 --- /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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/72/mcrypt.sh b/plugins/php/versions/72/mcrypt.sh index c65df5a28..d37a096b5 100755 --- a/plugins/php/versions/72/mcrypt.sh +++ b/plugins/php/versions/72/mcrypt.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -87,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/memcached.sh b/plugins/php/versions/72/memcached.sh index 22f7871fb..9b8a4e815 100755 --- a/plugins/php/versions/72/memcached.sh +++ b/plugins/php/versions/72/memcached.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/mongodb.sh b/plugins/php/versions/72/mongodb.sh index ba92f1267..f8ab90551 100755 --- a/plugins/php/versions/72/mongodb.sh +++ b/plugins/php/versions/72/mongodb.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/opcache.sh b/plugins/php/versions/72/opcache.sh index 2d3b4a759..0547b1b76 100755 --- a/plugins/php/versions/72/opcache.sh +++ b/plugins/php/versions/72/opcache.sh @@ -44,7 +44,7 @@ Install_lib() echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -55,7 +55,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/openssl.sh b/plugins/php/versions/72/openssl.sh index 165e01bd2..bdd1323e5 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 @@ -63,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/pcntl.sh b/plugins/php/versions/72/pcntl.sh index 4a458ef2a..796b84897 100755 --- a/plugins/php/versions/72/pcntl.sh +++ b/plugins/php/versions/72/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/redis.sh b/plugins/php/versions/72/redis.sh index 774119a76..fe782a92c 100755 --- a/plugins/php/versions/72/redis.sh +++ b/plugins/php/versions/72/redis.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/seaslog.sh b/plugins/php/versions/72/seaslog.sh index ad0746fda..dde11a1a1 100755 --- a/plugins/php/versions/72/seaslog.sh +++ b/plugins/php/versions/72/seaslog.sh @@ -67,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/solr.sh b/plugins/php/versions/72/solr.sh index e1c70fe07..2e6f508d4 100755 --- a/plugins/php/versions/72/solr.sh +++ b/plugins/php/versions/72/solr.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/swoole.sh b/plugins/php/versions/72/swoole.sh index 333707bbd..dae2f8eaf 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 @@ -74,7 +74,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -97,7 +97,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/xdebug.sh b/plugins/php/versions/72/xdebug.sh index c08c3dfa9..6e46ded96 100755 --- a/plugins/php/versions/72/xdebug.sh +++ b/plugins/php/versions/72/xdebug.sh @@ -56,9 +56,9 @@ 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -81,7 +81,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/xhprof.sh b/plugins/php/versions/72/xhprof.sh index 759081253..6c64c6d5f 100755 --- a/plugins/php/versions/72/xhprof.sh +++ b/plugins/php/versions/72/xhprof.sh @@ -66,7 +66,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/yac.sh b/plugins/php/versions/72/yac.sh index b97b6c742..d1fb22520 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 @@ -64,7 +64,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/yaf.sh b/plugins/php/versions/72/yaf.sh index e10fcef0c..2e0683075 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` @@ -64,7 +64,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/yar.sh b/plugins/php/versions/72/yar.sh index fdfea8970..0f0aa9c65 100755 --- a/plugins/php/versions/72/yar.sh +++ b/plugins/php/versions/72/yar.sh @@ -72,7 +72,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -97,7 +97,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/zip.sh b/plugins/php/versions/72/zip.sh index ab58ab823..4606559ba 100755 --- a/plugins/php/versions/72/zip.sh +++ b/plugins/php/versions/72/zip.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/72/zlib.sh b/plugins/php/versions/72/zlib.sh index 030733cb3..becdb182d 100755 --- a/plugins/php/versions/72/zlib.sh +++ b/plugins/php/versions/72/zlib.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/exif.sh b/plugins/php/versions/73/exif.sh index f52c194c5..7f02ce13b 100755 --- a/plugins/php/versions/73/exif.sh +++ b/plugins/php/versions/73/exif.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/fileinfo.sh b/plugins/php/versions/73/fileinfo.sh index 6966d6aaa..193f44b2e 100755 --- a/plugins/php/versions/73/fileinfo.sh +++ b/plugins/php/versions/73/fileinfo.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/imagemagick.sh b/plugins/php/versions/73/imagemagick.sh index fde729fad..6c9688423 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 @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/intl.sh b/plugins/php/versions/73/intl.sh index c58d8741c..480e003ba 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 @@ -61,7 +64,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/ioncube.sh b/plugins/php/versions/73/ioncube.sh new file mode 100755 index 000000000..ef5440382 --- /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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/73/mcrypt.sh b/plugins/php/versions/73/mcrypt.sh index c65df5a28..d37a096b5 100755 --- a/plugins/php/versions/73/mcrypt.sh +++ b/plugins/php/versions/73/mcrypt.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -87,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/memcached.sh b/plugins/php/versions/73/memcached.sh index d55d6da30..7867c851d 100755 --- a/plugins/php/versions/73/memcached.sh +++ b/plugins/php/versions/73/memcached.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/mongodb.sh b/plugins/php/versions/73/mongodb.sh index d7dd61db4..9a9c3180b 100755 --- a/plugins/php/versions/73/mongodb.sh +++ b/plugins/php/versions/73/mongodb.sh @@ -58,7 +58,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -81,7 +81,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/opcache.sh b/plugins/php/versions/73/opcache.sh index 1da2f3ee5..73d59f1ed 100755 --- a/plugins/php/versions/73/opcache.sh +++ b/plugins/php/versions/73/opcache.sh @@ -45,7 +45,7 @@ Install_lib() echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -56,7 +56,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/openssl.sh b/plugins/php/versions/73/openssl.sh index 165e01bd2..bdd1323e5 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 @@ -63,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/pcntl.sh b/plugins/php/versions/73/pcntl.sh index 4a458ef2a..796b84897 100755 --- a/plugins/php/versions/73/pcntl.sh +++ b/plugins/php/versions/73/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/redis.sh b/plugins/php/versions/73/redis.sh index e96b0eed9..723f604f2 100755 --- a/plugins/php/versions/73/redis.sh +++ b/plugins/php/versions/73/redis.sh @@ -58,7 +58,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/seaslog.sh b/plugins/php/versions/73/seaslog.sh index 07e8f3dd0..bd0ad3c7e 100755 --- a/plugins/php/versions/73/seaslog.sh +++ b/plugins/php/versions/73/seaslog.sh @@ -67,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/solr.sh b/plugins/php/versions/73/solr.sh index 636f1094d..7a9186002 100755 --- a/plugins/php/versions/73/solr.sh +++ b/plugins/php/versions/73/solr.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/swoole.sh b/plugins/php/versions/73/swoole.sh index 5db5d34b2..9d86a1171 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 @@ -73,7 +73,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -96,7 +96,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/xdebug.sh b/plugins/php/versions/73/xdebug.sh index a28100421..7355cf3d3 100755 --- a/plugins/php/versions/73/xdebug.sh +++ b/plugins/php/versions/73/xdebug.sh @@ -58,9 +58,9 @@ 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/xhprof.sh b/plugins/php/versions/73/xhprof.sh index 759081253..6c64c6d5f 100755 --- a/plugins/php/versions/73/xhprof.sh +++ b/plugins/php/versions/73/xhprof.sh @@ -66,7 +66,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/yac.sh b/plugins/php/versions/73/yac.sh index b97b6c742..d1fb22520 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 @@ -64,7 +64,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/yaf.sh b/plugins/php/versions/73/yaf.sh index 071ecaa34..72ab38df2 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 @@ -61,7 +61,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -85,7 +85,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/yar.sh b/plugins/php/versions/73/yar.sh index 02fc1d2f6..7e48bea34 100755 --- a/plugins/php/versions/73/yar.sh +++ b/plugins/php/versions/73/yar.sh @@ -65,7 +65,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/zip.sh b/plugins/php/versions/73/zip.sh index ab58ab823..4606559ba 100755 --- a/plugins/php/versions/73/zip.sh +++ b/plugins/php/versions/73/zip.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/73/zlib.sh b/plugins/php/versions/73/zlib.sh index 030733cb3..becdb182d 100755 --- a/plugins/php/versions/73/zlib.sh +++ b/plugins/php/versions/73/zlib.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/exif.sh b/plugins/php/versions/74/exif.sh index f52c194c5..7f02ce13b 100755 --- a/plugins/php/versions/74/exif.sh +++ b/plugins/php/versions/74/exif.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/fileinfo.sh b/plugins/php/versions/74/fileinfo.sh index 6966d6aaa..193f44b2e 100755 --- a/plugins/php/versions/74/fileinfo.sh +++ b/plugins/php/versions/74/fileinfo.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/gd.sh b/plugins/php/versions/74/gd.sh index b20f69ba2..f4939fe7e 100755 --- a/plugins/php/versions/74/gd.sh +++ b/plugins/php/versions/74/gd.sh @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/imagemagick.sh b/plugins/php/versions/74/imagemagick.sh index fde729fad..6c9688423 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 @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/install.sh b/plugins/php/versions/74/install.sh index 7629e4f74..a111ad05a 100755 --- a/plugins/php/versions/74/install.sh +++ b/plugins/php/versions/74/install.sh @@ -57,7 +57,7 @@ fi echo "$sourcePath/php/php${PHP_VER}" if [ ! -d $serverPath/php/${PHP_VER} ];then - cd $sourcePath/php/php${PHP_VER} + cd $sourcePath/php/php${PHP_VER} && make clean ./buildconf --force ./configure \ --prefix=$serverPath/php/${PHP_VER} \ @@ -80,7 +80,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then --disable-fileinfo \ $OPTIONS \ --enable-fpm - make && make install && make clean + make && make install && make clean fi #------------------------ install end ------------------------------------# } diff --git a/plugins/php/versions/74/intl.sh b/plugins/php/versions/74/intl.sh index c58d8741c..480e003ba 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 @@ -61,7 +64,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/ioncube.sh b/plugins/php/versions/74/ioncube.sh new file mode 100755 index 000000000..ef5440382 --- /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 + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/74/mcrypt.sh b/plugins/php/versions/74/mcrypt.sh index c65df5a28..d37a096b5 100755 --- a/plugins/php/versions/74/mcrypt.sh +++ b/plugins/php/versions/74/mcrypt.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -87,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/memcached.sh b/plugins/php/versions/74/memcached.sh index d58333bbf..7a31cee78 100755 --- a/plugins/php/versions/74/memcached.sh +++ b/plugins/php/versions/74/memcached.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/mongodb.sh b/plugins/php/versions/74/mongodb.sh index d0f8c1a54..1441e172f 100755 --- a/plugins/php/versions/74/mongodb.sh +++ b/plugins/php/versions/74/mongodb.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/opcache.sh b/plugins/php/versions/74/opcache.sh index a8fe50112..d0994e3c7 100755 --- a/plugins/php/versions/74/opcache.sh +++ b/plugins/php/versions/74/opcache.sh @@ -44,7 +44,7 @@ Install_lib() echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -55,7 +55,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/openssl.sh b/plugins/php/versions/74/openssl.sh index 165e01bd2..bdd1323e5 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 @@ -63,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/pcntl.sh b/plugins/php/versions/74/pcntl.sh index 4a458ef2a..796b84897 100755 --- a/plugins/php/versions/74/pcntl.sh +++ b/plugins/php/versions/74/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/redis.sh b/plugins/php/versions/74/redis.sh index 2133fd31f..5e7616828 100755 --- a/plugins/php/versions/74/redis.sh +++ b/plugins/php/versions/74/redis.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/seaslog.sh b/plugins/php/versions/74/seaslog.sh index 7146787e9..51a6e43c6 100755 --- a/plugins/php/versions/74/seaslog.sh +++ b/plugins/php/versions/74/seaslog.sh @@ -67,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/solr.sh b/plugins/php/versions/74/solr.sh index f53e2c54f..b6fcb1250 100755 --- a/plugins/php/versions/74/solr.sh +++ b/plugins/php/versions/74/solr.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/swoole.sh b/plugins/php/versions/74/swoole.sh index 1ca2c0d7f..abd4a3676 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` @@ -75,7 +75,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -98,7 +98,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/xdebug.sh b/plugins/php/versions/74/xdebug.sh index bb2aac870..92545ce59 100755 --- a/plugins/php/versions/74/xdebug.sh +++ b/plugins/php/versions/74/xdebug.sh @@ -60,9 +60,9 @@ 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -85,7 +85,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/xhprof.sh b/plugins/php/versions/74/xhprof.sh index e371ddc36..8751501bd 100755 --- a/plugins/php/versions/74/xhprof.sh +++ b/plugins/php/versions/74/xhprof.sh @@ -67,7 +67,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/yac.sh b/plugins/php/versions/74/yac.sh index b97b6c742..d1fb22520 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 @@ -64,7 +64,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/yaf.sh b/plugins/php/versions/74/yaf.sh index 071ecaa34..72ab38df2 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 @@ -61,7 +61,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -85,7 +85,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/yar.sh b/plugins/php/versions/74/yar.sh index fcf7118b3..bd7adc8b8 100755 --- a/plugins/php/versions/74/yar.sh +++ b/plugins/php/versions/74/yar.sh @@ -65,7 +65,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/zip.sh b/plugins/php/versions/74/zip.sh index ab58ab823..4606559ba 100755 --- a/plugins/php/versions/74/zip.sh +++ b/plugins/php/versions/74/zip.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/74/zlib.sh b/plugins/php/versions/74/zlib.sh index 030733cb3..becdb182d 100755 --- a/plugins/php/versions/74/zlib.sh +++ b/plugins/php/versions/74/zlib.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/exif.sh b/plugins/php/versions/80/exif.sh index f52c194c5..7f02ce13b 100755 --- a/plugins/php/versions/80/exif.sh +++ b/plugins/php/versions/80/exif.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/fileinfo.sh b/plugins/php/versions/80/fileinfo.sh index 6966d6aaa..193f44b2e 100755 --- a/plugins/php/versions/80/fileinfo.sh +++ b/plugins/php/versions/80/fileinfo.sh @@ -66,7 +66,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/gd.sh b/plugins/php/versions/80/gd.sh index b20f69ba2..f4939fe7e 100755 --- a/plugins/php/versions/80/gd.sh +++ b/plugins/php/versions/80/gd.sh @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/imagemagick.sh b/plugins/php/versions/80/imagemagick.sh index fde729fad..6c9688423 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 @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/intl.sh b/plugins/php/versions/80/intl.sh index c58d8741c..480e003ba 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 @@ -61,7 +64,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/mcrypt.sh b/plugins/php/versions/80/mcrypt.sh index c65df5a28..d37a096b5 100755 --- a/plugins/php/versions/80/mcrypt.sh +++ b/plugins/php/versions/80/mcrypt.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -87,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/memcached.sh b/plugins/php/versions/80/memcached.sh index 09085fb13..071742fae 100755 --- a/plugins/php/versions/80/memcached.sh +++ b/plugins/php/versions/80/memcached.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/mongodb.sh b/plugins/php/versions/80/mongodb.sh index d0f8c1a54..1441e172f 100755 --- a/plugins/php/versions/80/mongodb.sh +++ b/plugins/php/versions/80/mongodb.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/opcache.sh b/plugins/php/versions/80/opcache.sh index 13b915da4..2836741a6 100755 --- a/plugins/php/versions/80/opcache.sh +++ b/plugins/php/versions/80/opcache.sh @@ -47,7 +47,7 @@ Install_lib() echo "opcache.jit_buffer_size=64M" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -58,7 +58,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/openssl.sh b/plugins/php/versions/80/openssl.sh index 165e01bd2..bdd1323e5 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 @@ -63,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/pcntl.sh b/plugins/php/versions/80/pcntl.sh index 4a458ef2a..796b84897 100755 --- a/plugins/php/versions/80/pcntl.sh +++ b/plugins/php/versions/80/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/redis.sh b/plugins/php/versions/80/redis.sh index 6a30255ea..cb1eb9ac6 100755 --- a/plugins/php/versions/80/redis.sh +++ b/plugins/php/versions/80/redis.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/seaslog.sh b/plugins/php/versions/80/seaslog.sh index 0998a8385..5a685f1e3 100755 --- a/plugins/php/versions/80/seaslog.sh +++ b/plugins/php/versions/80/seaslog.sh @@ -67,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/solr.sh b/plugins/php/versions/80/solr.sh index f53e2c54f..b6fcb1250 100755 --- a/plugins/php/versions/80/solr.sh +++ b/plugins/php/versions/80/solr.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/swoole.sh b/plugins/php/versions/80/swoole.sh index f599d070e..10085eced 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 @@ -74,7 +74,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -97,7 +97,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/xdebug.sh b/plugins/php/versions/80/xdebug.sh index 8c31817f5..902e1727b 100755 --- a/plugins/php/versions/80/xdebug.sh +++ b/plugins/php/versions/80/xdebug.sh @@ -59,9 +59,9 @@ 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/xhprof.sh b/plugins/php/versions/80/xhprof.sh index 759081253..6c64c6d5f 100755 --- a/plugins/php/versions/80/xhprof.sh +++ b/plugins/php/versions/80/xhprof.sh @@ -66,7 +66,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/yac.sh b/plugins/php/versions/80/yac.sh index b97b6c742..d1fb22520 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 @@ -64,7 +64,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/yaf.sh b/plugins/php/versions/80/yaf.sh index a74c212ac..ef2a6b047 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` @@ -62,7 +62,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/yar.sh b/plugins/php/versions/80/yar.sh index 77ee0fa9f..b697cc354 100755 --- a/plugins/php/versions/80/yar.sh +++ b/plugins/php/versions/80/yar.sh @@ -65,7 +65,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/zip.sh b/plugins/php/versions/80/zip.sh index 172a42fd5..dc877acbe 100755 --- a/plugins/php/versions/80/zip.sh +++ b/plugins/php/versions/80/zip.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/80/zlib.sh b/plugins/php/versions/80/zlib.sh index 030733cb3..becdb182d 100755 --- a/plugins/php/versions/80/zlib.sh +++ b/plugins/php/versions/80/zlib.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/exif.sh b/plugins/php/versions/81/exif.sh index f52c194c5..7f02ce13b 100755 --- a/plugins/php/versions/81/exif.sh +++ b/plugins/php/versions/81/exif.sh @@ -68,7 +68,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/fileinfo.sh b/plugins/php/versions/81/fileinfo.sh index 6d1b09453..7b23e1913 100755 --- a/plugins/php/versions/81/fileinfo.sh +++ b/plugins/php/versions/81/fileinfo.sh @@ -73,7 +73,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -96,7 +96,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/gd.sh b/plugins/php/versions/81/gd.sh index b20f69ba2..f4939fe7e 100755 --- a/plugins/php/versions/81/gd.sh +++ b/plugins/php/versions/81/gd.sh @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/imagemagick.sh b/plugins/php/versions/81/imagemagick.sh index fde729fad..6c9688423 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 @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/intl.sh b/plugins/php/versions/81/intl.sh index c58d8741c..0450ac269 100755 --- a/plugins/php/versions/81/intl.sh +++ b/plugins/php/versions/81/intl.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/mcrypt.sh b/plugins/php/versions/81/mcrypt.sh index c65df5a28..d37a096b5 100755 --- a/plugins/php/versions/81/mcrypt.sh +++ b/plugins/php/versions/81/mcrypt.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -87,7 +87,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/memcached.sh b/plugins/php/versions/81/memcached.sh index 63bfc33ac..2d5962c37 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 @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/mongodb.sh b/plugins/php/versions/81/mongodb.sh index d0f8c1a54..1441e172f 100755 --- a/plugins/php/versions/81/mongodb.sh +++ b/plugins/php/versions/81/mongodb.sh @@ -60,7 +60,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -83,7 +83,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/opcache.sh b/plugins/php/versions/81/opcache.sh index ab0e20653..c4cf9df40 100755 --- a/plugins/php/versions/81/opcache.sh +++ b/plugins/php/versions/81/opcache.sh @@ -48,7 +48,7 @@ Install_lib() echo "opcache.jit_buffer_size=64M" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -59,7 +59,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/openssl.sh b/plugins/php/versions/81/openssl.sh index 165e01bd2..6b91a36ea 100755 --- a/plugins/php/versions/81/openssl.sh +++ b/plugins/php/versions/81/openssl.sh @@ -63,7 +63,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/pcntl.sh b/plugins/php/versions/81/pcntl.sh index 4a458ef2a..796b84897 100755 --- a/plugins/php/versions/81/pcntl.sh +++ b/plugins/php/versions/81/pcntl.sh @@ -59,7 +59,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -82,7 +82,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/redis.sh b/plugins/php/versions/81/redis.sh index 6c9359249..33d1147fb 100755 --- a/plugins/php/versions/81/redis.sh +++ b/plugins/php/versions/81/redis.sh @@ -61,7 +61,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -85,7 +85,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/seaslog.sh b/plugins/php/versions/81/seaslog.sh index 0998a8385..5a685f1e3 100755 --- a/plugins/php/versions/81/seaslog.sh +++ b/plugins/php/versions/81/seaslog.sh @@ -67,7 +67,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -91,7 +91,7 @@ Uninstall_lib() sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/solr.sh b/plugins/php/versions/81/solr.sh index f53e2c54f..b6fcb1250 100755 --- a/plugins/php/versions/81/solr.sh +++ b/plugins/php/versions/81/solr.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/swoole.sh b/plugins/php/versions/81/swoole.sh index f599d070e..10085eced 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 @@ -74,7 +74,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -97,7 +97,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/xdebug.sh b/plugins/php/versions/81/xdebug.sh index 8c31817f5..902e1727b 100755 --- a/plugins/php/versions/81/xdebug.sh +++ b/plugins/php/versions/81/xdebug.sh @@ -59,9 +59,9 @@ 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -84,7 +84,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/xhprof.sh b/plugins/php/versions/81/xhprof.sh index 759081253..6c64c6d5f 100755 --- a/plugins/php/versions/81/xhprof.sh +++ b/plugins/php/versions/81/xhprof.sh @@ -66,7 +66,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -89,7 +89,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/yac.sh b/plugins/php/versions/81/yac.sh index b97b6c742..d1fb22520 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 @@ -64,7 +64,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/yaf.sh b/plugins/php/versions/81/yaf.sh index 0eebee9fd..ef2a6b047 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` @@ -62,7 +62,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -86,7 +86,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/yar.sh b/plugins/php/versions/81/yar.sh index 77ee0fa9f..b697cc354 100755 --- a/plugins/php/versions/81/yar.sh +++ b/plugins/php/versions/81/yar.sh @@ -65,7 +65,7 @@ Install_lib() echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -90,7 +90,7 @@ Uninstall_lib() sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/zip.sh b/plugins/php/versions/81/zip.sh index 172a42fd5..dc877acbe 100755 --- a/plugins/php/versions/81/zip.sh +++ b/plugins/php/versions/81/zip.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/81/zlib.sh b/plugins/php/versions/81/zlib.sh index 030733cb3..becdb182d 100755 --- a/plugins/php/versions/81/zlib.sh +++ b/plugins/php/versions/81/zlib.sh @@ -65,7 +65,7 @@ Install_lib() 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 + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===========================================================' echo 'successful!' } @@ -88,7 +88,7 @@ Uninstall_lib() sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini rm -f $extFile - $serverPath/php/init.d/php$version reload + bash ${rootPath}/plugins/php/versions/lib.sh $version restart echo '===============================================' echo 'successful!' } diff --git a/plugins/php/versions/lib.sh b/plugins/php/versions/lib.sh new file mode 100644 index 000000000..968a3ead1 --- /dev/null +++ b/plugins/php/versions/lib.sh @@ -0,0 +1,19 @@ +#!/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") + +version=$1 +action=$2 + +if [ -f /lib/systemd/system/php${version}.service ];then + systemctl ${action} php${version} +else + $serverPath/php/init.d/php${version} ${action} +fi \ No newline at end of file diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 55fb68527..d1c903c96 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -23,11 +23,22 @@ }, { "name": "ionCube", - "versions": [], + "versions": [ + "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", @@ -52,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/plugins/pureftp/index.py b/plugins/pureftp/index.py index ab53099dc..d54b245b5 100755 --- a/plugins/pureftp/index.py +++ b/plugins/pureftp/index.py @@ -59,6 +59,13 @@ def getArgs(): return tmp +def checkArgs(data, ck=[]): + for i in range(len(ck)): + if not ck[i] in data: + return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!')) + return (True, mw.returnJson(True, 'ok')) + + def status(): cmd = "ps -ef|grep pure-ftpd |grep -v grep | grep -v python | awk '{print $2}'" data = mw.execShell(cmd) @@ -113,7 +120,9 @@ def initDreplace(): systemDir = '/lib/systemd/system' systemService = systemDir + '/pureftp.service' systemServiceTpl = getPluginDir() + '/init.d/pureftp.service.tpl' - if os.path.exists(systemDir) and not os.path.exists(systemService): + + if os.path.exists(systemDir): + # and not os.path.exists(systemService) se_content = mw.readFile(systemServiceTpl) se_content = se_content.replace('{$SERVER_PATH}', service_path) mw.writeFile(systemService, se_content) @@ -122,72 +131,61 @@ def initDreplace(): return file_bin -def start(): +def pfOp(method): file = initDreplace() - data = mw.execShell(file + ' start') + + if not mw.isAppleSystem(): + data = mw.execShell('systemctl ' + method + ' pureftp') + if data[1] == '': + return 'ok' + return 'fail' + + data = mw.execShell(file + ' ' + method) if data[1] == '': return 'ok' return data[1] +def start(): + return pfOp('start') + + def stop(): - file = initDreplace() - data = mw.execShell(file + ' stop') - if data[1] == '': - return 'ok' - return data[1] + return pfOp('stop') def restart(): - file = initDreplace() - data = mw.execShell(file + ' restart') - if data[1] == '': - return 'ok' - return 'fail' + return pfOp('restart') def reload(): - file = initDreplace() - data = mw.execShell(file + ' reload') - if data[1] == '': - return 'ok' - return data[1] + return pfOp('reload') def initdStatus(): - if not app_debug: - os_name = mw.getOs() - if os_name == 'darwin': - return "Apple Computer does not support" - initd_bin = getInitDFile() - if os.path.exists(initd_bin): - return 'ok' - return 'fail' + if mw.isAppleSystem(): + return "Apple Computer does not support" + + shell_cmd = 'systemctl status pureftp | grep loaded | grep "enabled;"' + data = mw.execShell(shell_cmd) + if data[0] == '': + return 'fail' + return 'ok' def initdInstall(): - import shutil - if not app_debug: - os_name = mw.getOs() - if os_name == 'darwin': - return "Apple Computer does not support" + if mw.isAppleSystem(): + return "Apple Computer does not support" - source_bin = initDreplace() - initd_bin = getInitDFile() - shutil.copyfile(source_bin, initd_bin) - mw.execShell('chmod +x ' + initd_bin) - mw.execShell('chkconfig --add ' + getPluginName()) + mw.execShell('systemctl start pureftp') return 'ok' def initdUinstall(): - if not app_debug: - os_name = mw.getOs() - if os_name == 'darwin': - return "Apple Computer does not support" - initd_bin = getInitDFile() - os.remove(initd_bin) - mw.execShell('chkconfig --del ' + getPluginName()) + if mw.isAppleSystem(): + return "Apple Computer does not support" + + mw.execShell('systemctl stop pureftp') return 'ok' @@ -218,6 +216,7 @@ def pftpAdd(username, password, path): if not os.path.exists(path): os.makedirs(path) if mw.isAppleSystem(): + # pass os.system('chown ' + user + '.staff ' + path) else: os.system('chown www.www ' + path) @@ -245,8 +244,9 @@ def pftpStart(username): def pftpReload(): - mw.execShell(getServerDir() + '/bin/pure-pw mkdb ' + - getServerDir() + '/etc/pureftpd.pdb') + cmd = getServerDir() + '/bin/pure-pw mkdb ' + \ + getServerDir() + '/etc/pureftpd.pdb' + mw.execShell(cmd) def getWwwDir(): @@ -309,21 +309,13 @@ def getFtpList(): def addFtp(): - import urllib + import urllib.parse args = getArgs() - if not 'ftp_username' in args: - return 'ftp_username missing' + data = checkArgs(args, ['ftp_username', 'ftp_password', 'path', 'ps']) + if not data[0]: + return data[1] - if not 'ftp_password' in args: - return 'ftp_password missing' - - if not 'path' in args: - return 'path missing' - - if not 'ps' in args: - return 'ps missing' - - path = urllib.unquote(args['path']) + path = urllib.parse.unquote(args['path']) user = args['ftp_username'] pwd = args['ftp_password'] ps = args['ps'] @@ -342,11 +334,9 @@ def addFtp(): def delFtp(): args = getArgs() - if not 'id' in args: - return 'ftp_username missing' - - if not 'username' in args: - return 'username missing' + data = checkArgs(args, ['id', 'username']) + if not data[0]: + return data[1] mw.execShell(getServerDir() + '/bin/pure-pw userdel ' + args['username']) @@ -359,14 +349,9 @@ def delFtp(): def modFtp(): args = getArgs() - if not 'id' in args: - return 'id missing' - - if not 'name' in args: - return 'name missing' - - if not 'password' in args: - return 'password missing' + data = checkArgs(args, ['id', 'name', 'password']) + if not data[0]: + return data[1] conn = pftpDB() data = pftpMod(args['name'], args['password']) diff --git a/plugins/pureftp/init.d/pureftp.service.tpl b/plugins/pureftp/init.d/pureftp.service.tpl index 227ccc451..7d632eae8 100644 --- a/plugins/pureftp/init.d/pureftp.service.tpl +++ b/plugins/pureftp/init.d/pureftp.service.tpl @@ -2,9 +2,11 @@ Description=Pure-FTPd is a fast, production-quality, standard-conformant FTP server After=network.target + + [Service] Type=forking -ExecStart={$SERVER_PATH}/pureftp/sbin/pure-ftpd {$SERVER_PATH}/pureftp/etc/pure-ftpd.conf --daemonize +ExecStart={$SERVER_PATH}/pureftp/sbin/pure-ftpd {$SERVER_PATH}/pureftp/etc/pure-ftpd.conf ExecStop=/bin/kill -HUP $MAINPID ExecReload=/bin/kill -USR2 $MAINPID Restart=on-failure diff --git a/plugins/pureftp/install.sh b/plugins/pureftp/install.sh index 4c87fc1b4..b314cc93b 100755 --- a/plugins/pureftp/install.sh +++ b/plugins/pureftp/install.sh @@ -28,8 +28,19 @@ else OSNAME='unknow' fi + + + Install_pureftp() { + if id ftp &> /dev/null ;then + echo "ftp UID is `id -u ftp`" + echo "ftp Shell is `grep "^ftp:" /etc/passwd |cut -d':' -f7 `" + else + groupadd ftp + useradd -g ftp -s /sbin/nologin ftp + fi + # mkdir -p ${serverPath}/pureftp mkdir -p ${serverPath}/source/pureftp @@ -40,13 +51,10 @@ Install_pureftp() VER=$1 DOWNLOAD=https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-${VER}.tar.gz - if [ ! -f $serverPath/source/pureftp/pure-ftpd-${VER}.tar.gz ];then wget --no-check-certificate -O $serverPath/source/pureftp/pure-ftpd-${VER}.tar.gz $DOWNLOAD fi - - #检测文件是否损坏. md5_ok=451879495ba61c1d7dcfca8dd231119f if [ -f $serverPath/source/pureftp/pure-ftpd-${VER}.tar.gz ];then @@ -92,6 +100,8 @@ Uninstall_pureftp() fi rm -rf ${serverPath}/pureftp + userdel ftp + groupdel ftp echo '卸载完成' > $install_tmp } diff --git a/plugins/pureftp/js/ftp.js b/plugins/pureftp/js/ftp.js index 3dc20ab1f..42afdfc6e 100755 --- a/plugins/pureftp/js/ftp.js +++ b/plugins/pureftp/js/ftp.js @@ -24,7 +24,6 @@ function ftpPost(method,args,callback){ layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']}); return; } - if(typeof(callback) == 'function'){ callback(data); } @@ -74,7 +73,7 @@ function ftpList(page, search){ content += '状态'; content += '根目录'; content += '备注'; - content += '操作(添加|端口)'; + content += '操作(添加|端口)'; content += ''; content += ''; @@ -111,35 +110,20 @@ function ftpList(page, search){ /** *添加FTP帐户 - * @param {Number} type 添加类型 */ -function addFtp(type) { - if (type == 1) { - var loadT = layer.load({shade: true,shadeClose: false}); - var data = $("#ftpAdd").serialize(); - ftpPost('add_ftp', data, function(data){ - if (data.data == 'ok'){ - layer.msg('添加成功!', {icon: 1}); - } else { - layer.msg(rdata.data, {icon: 5}); - } - ftpList(); - layer.close(loadT); - }); - return true; - } +function addFtp() { var data = ftpAsyncPost('get_www_dir'); var defaultPath = data.data; - var index = layer.open({ + var indexFtp = layer.open({ type: 1, - skin: 'demo-class', area: '500px', title: '添加FTP帐户', closeBtn: 2, shift: 5, shadeClose: false, - content: "
\ + btn: ['提交','关闭'], + content: "\
\ 用户名\
\ @@ -157,11 +141,23 @@ function addFtp(type) {
\ \
\ -
\ - \ - \ -
\
", + yes:function(index,layero){ + var loadT = layer.load({shade: true,shadeClose: false}); + var data = $("#ftpAdd").serialize(); + ftpPost('add_ftp', data, function(rdata){ + layer.close(loadT); + layer.close(indexFtp); + if (rdata.data == 'ok'){ + layer.msg('添加成功!', {icon: 1,time:3000}); + } else { + layer.msg(rdata.data, {icon: 5,time:3000}); + } + + setTimeout(function(){ftpList();},2000); + }); + return true; + }, }); $("#ftpUser").keyup(function(){ 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 02e7866b8..325bf6f9e 100755 --- a/route/static/app/site.js +++ b/route/static/app/site.js @@ -163,8 +163,22 @@ function setWebPs(b, e, a) { },'json'); } +//创建站点前,检查服务是否开启 +function webAdd(type){ + loading = layer.msg('正在检查是否开启OpenResty服务!',{icon:16,time:0,shade: [0.3, "#000"]}) + $.post('/site/check_web_status', function(data){ + layer.close(loading); + if (data.status){ + webAddPage(type) + } else { + layer.msg(data.msg,{icon:0,time:3000,shade: [0.3, "#000"]}) + } + },'json'); +} + //添加站点 -function webAdd(type) { +function webAddPage(type) { + if (type == 1) { var array; var str=""; @@ -994,9 +1008,11 @@ function webEdit(id,website,endTime,addtime){ +"

SSL

" +"

PHP版本

" +"

重定向

" - +"

反向代理

" + +"

反向代理

" +"

防盗链

" - +"

响应日志

"; + +"

响应日志

" + +"

错误日志

"; + layer.open({ type: 1, area: '640px', @@ -1039,7 +1055,24 @@ function webEdit(id,website,endTime,addtime){ function getSiteLogs(siteName){ var loadT = layer.msg('正在处理,请稍候...',{icon:16,time:0,shade: [0.3, '#000']}); $.post('/site/get_logs',{siteName:siteName},function(logs){ - console.log(logs); + // console.log(logs); + layer.close(loadT); + if(logs.status !== true){ + logs.msg = ''; + } + if (logs.msg == '') logs.msg = '当前没有日志.'; + var phpCon = ''; + $("#webedit-con").html(phpCon); + var ob = document.getElementById('error_log'); + ob.scrollTop = ob.scrollHeight; + },'json'); +} + +//取网站错误日志 +function getSiteErrorLogs(siteName){ + var loadT = layer.msg('正在处理,请稍候...',{icon:16,time:0,shade: [0.3, '#000']}); + $.post('/site/get_error_logs',{siteName:siteName},function(logs){ + // console.log(logs); layer.close(loadT); if(logs.status !== true){ logs.msg = ''; @@ -1366,51 +1399,6 @@ function delDirBind(id,siteId){ }); } -//反向代理 -function proxyList(siteName,type){ - if(type == 1){ - type = $("input[name='status']").attr('checked')?'0':'1'; - toUrl = encodeURIComponent($("input[name='toUrl']").val()); - toDomain = encodeURIComponent($("input[name='toDomain']").val()); - var sub1 = encodeURIComponent($("input[name='sub1']").val()); - var sub2 = encodeURIComponent($("input[name='sub2']").val()); - var data = 'name='+siteName+'&type='+type+'&proxyUrl='+toUrl+'&toDomain=' + toDomain + '&sub1=' + sub1 + '&sub2=' + sub2; - var loadT = layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']}); - $.post('/site?action=SetProxy',data,function(rdata){ - layer.close(loadT); - if(rdata.status) { - Proxy(siteName); - }else{ - $("input[name='status']").attr('checked',false) - } - layer.msg(rdata.msg,{icon:rdata.status?1:2}); - }); - return; - } - var loadT = layer.msg(lan.site.the_msg,{icon:16,time:0,shade: [0.3, '#000']}); - $.post('/site?action=GetProxy','name='+siteName,function(rdata){ - layer.close(loadT); - if(rdata.proxyUrl == null) rdata.proxyUrl = ''; - var status_selected = rdata.status?'checked':''; - var disabled = rdata.status?'disabled':''; - var body = "
" - +"

"+lan.site.proxy_url+"

" - +"

"+lan.site.proxy_domain+"

" - +"

"+lan.site.con_rep+"" - +"

" - +'
' - +'' - +"
"; - $("#webedit-con").html(body); - }); -} - //开启缓存 function openCache(siteName){ var loadT = layer.msg(lan.site.the_msg,{icon:16,time:0,shade: [0.3, '#000']}); @@ -1633,6 +1621,134 @@ function to301(siteName, type, obj){ }); } + +//反向代理 +function toProxy(siteName, type, obj) { + + + // 设置 页面展示 + if(type == 1) { + var proxy_form = layer.open({ + type: 1, + skin: 'demo-class', + area: '650px', + title: "创建反向代理", + closeBtn: 2, + shift: 5, + shadeClose: false, + content: "
" + + "
"+ + "目标URL" + + "
" + + "" + + "
" + + "
" + + "
" + + "代理目录" + + "
" + + "" + + "发送域名" + + "" + + "
" + + "
" + + "
" + + "
" + }); + setTimeout(function() { + $('.btn-colse-proxy').click(function() { + layer.close(proxy_form); + }); + $('.btn-submit-proxy').click(function() { + var to = $('[name="to"]').val(); + var from = $('[name="from"]').val(); + var host = $('[name="host"]').val(); + + $.post('/site/set_proxy', { + siteName: siteName, + from: from, + to: to, + host: host, + }, function(res) { + res = JSON.parse(res); + if (res.status) { + layer.close(proxy_form); + toProxy(siteName) + } else { + layer.msg(res.msg, { + icon: 2 + }); + } + }); + }); + }, 100); + } + + if (type == 2) { + $.post('/site/del_proxy', { + siteName: siteName, + id: obj, + }, function(res) { + res = JSON.parse(res); + if (res.status == true) { + layer.msg('删除成功', { + time: 1000, + icon: 1 + }); + toProxy(siteName) + } else { + layer.msg(res.msg, { + time: 1000, + icon: 2 + }); + } + }); + return + } + + + var body = '
\ +
\ + \ +
\ +
\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
代理目录目标地址操作
\ +
\ +
'; + $("#webedit-con").html(body); + + var loadT = layer.msg(lan.site.the_msg,{icon:16,time:0,shade: [0.3, '#000']}); + $.post("/site/get_proxy_list", { + siteName: siteName + },function (response) { + layer.close(loadT); + $("#md-301-loading").remove(); + let res = JSON.parse(response); + if (res.status === true) { + let data = res.data.result; + data.forEach(function(item){ + let tmp = '\ + '+item.from+'\ + '+item.to+'\ + 删除\ + '; + $("#md-301-body").append(tmp); + }) + } else { + layer.msg(res.msg, {icon:2}); + } +}) +} + //文件验证 // function file_check(){ // $(".check_message").html('
\ 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..6d4a66c2e 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -65,10 +65,44 @@ chmod 755 /www/server/mdserver-web/data +# mysql8.0 在ubuntu22需要的库 +apt install -y patchelf + +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/install_dev.sh b/scripts/install_dev.sh index 572c83044..34a8d63ce 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -67,7 +67,7 @@ if [ $OSNAME != "macos" ];then if [ ! -d /www/server/mdserver-web ];then wget -O /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip cd /tmp && unzip /tmp/dev.zip - mv -f /tmp/mdserver-web-master /www/server/mdserver-web + mv -f /tmp/mdserver-web-dev /www/server/mdserver-web rm -rf /tmp/dev.zip rm -rf /tmp/mdserver-web-dev fi diff --git a/scripts/lib.sh b/scripts/lib.sh index b7364666d..27acceac7 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -255,6 +255,8 @@ else OSNAME='unknow' fi +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` +echo "${OSNAME}:${VERSION_ID}" # system judge if [ "$OSNAME" == "macos" ]; then @@ -270,16 +272,25 @@ 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 gcc 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 libmemcached-dev + apt install -y libsasl2-dev + apt install -y imagemagick + apt install -y 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 @@ -290,14 +301,19 @@ 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 build-essential + apt install -y libcurl4-openssl-dev apt install -y curl libcurl4-gnutls-dev #https://blog.csdn.net/qq_36228377/article/details/123154344 - ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl + # ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl + if [ ! -d /usr/include/curl ];then + ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl + fi + apt install -y graphviz bison re2c flex apt install -y libsqlite3-dev @@ -346,8 +362,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==21.1.2 pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 @@ -357,6 +371,10 @@ 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 [ ! -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 @@ -368,8 +386,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==21.1.2 pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 @@ -379,7 +395,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 ##### common start ##### diff --git a/scripts/quick/app.sh b/scripts/quick/app.sh index f411bab40..d8310683c 100755 --- a/scripts/quick/app.sh +++ b/scripts/quick/app.sh @@ -14,7 +14,6 @@ fi # openresty if [ ! -d /www/server/openresty ];then cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.1 - cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start else echo "openresty alreay exist!" fi @@ -23,19 +22,32 @@ fi # php if [ ! -d /www/server/php/71 ];then cd /www/server/mdserver-web/plugins/php && bash install.sh install 71 - cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71 else echo "php71 alreay exist!" fi + +# php +if [ ! -d /www/server/php/74 ];then + cd /www/server/mdserver-web/plugins/php && bash install.sh install 74 +else + echo "php74 alreay exist!" +fi + # mysql if [ ! -d /www/server/mysql ];then - cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.5 - cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5 + cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.6 else echo "mysql alreay exist!" fi +# phpmyadmin +if [ ! -d /www/server/phpmyadmin ];then + cd /www/server/mdserver-web/plugins/phpmyadmin && bash install.sh install 4.4.15 +else + echo "phpmyadmin alreay exist!" +fi + endTime=`date +%s` ((outTime=(${endTime}-${startTime})/60)) echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" diff --git a/scripts/quick/debug.sh b/scripts/quick/debug.sh index 27347444f..a23015b50 100755 --- a/scripts/quick/debug.sh +++ b/scripts/quick/debug.sh @@ -14,24 +14,23 @@ fi # openresty if [ ! -d /www/server/openresty ];then cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.1 - cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start fi # php -if [ ! -d /www/server/php/71 ];then - cd /www/server/mdserver-web/plugins/php && bash install.sh install 71 - cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71 -fi +# if [ ! -d /www/server/php/71 ];then +# cd /www/server/mdserver-web/plugins/php && bash install.sh install 71 +# fi -PHP_VER_LIST=(53 54 55 56 71 72 73 74 80 81) +PHP_VER_LIST=(52 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" - cd /www/server/mdserver-web/plugins/php && bash install.sh install ${PHP_VER} - cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start ${PHP_VER} + if [ ! -d /www/server/php/${PHP_VER} ];then + cd /www/server/mdserver-web/plugins/php && bash install.sh install ${PHP_VER} + fi echo "php${PHP_VER} -- end" done @@ -39,13 +38,10 @@ done # mysql if [ ! -d /www/server/mysql ];then # cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.7 - # cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.7 # cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.6 - # cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.6 cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 8.0 - cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 8.0 fi endTime=`date +%s` diff --git a/task.py b/task.py index 67f486cd6..24b0dc10c 100755 --- a/task.py +++ b/task.py @@ -388,6 +388,15 @@ def check502(): def startPHPVersion(version): sdir = mw.getServerDir() try: + + # system + phpService = '/lib/systemd/system/php' + version + '.service' + if os.path.exists(phpService): + mw.execShell("systemctl restart php" + version) + if checkPHPVersion(version): + return True + + # initd fpm = sdir + '/php/init.d/php' + version php_path = sdir + '/php/' + version + '/sbin/php-fpm' if not os.path.exists(php_path): @@ -432,34 +441,40 @@ def startPHPVersion(version): def checkPHPVersion(version): try: url = 'http://127.0.0.1/phpfpm_status_' + version - result = mw.httpGet(url) - # print(version,result) - # 检查openresty - if result.find('Bad Gateway') != -1: - return False - if result.find('HTTP Error 404: Not Found') != -1: - return False + result = mw.httpGet(url, 1) + if result.find('timed out'): + raise + except Exception as e: + url = 'http://' + mw.getLocalIp() + '/phpfpm_status_' + version + result = mw.httpGet(url, 1) + else: + result = 'Bad Gateway' - # 检查Web服务是否启动 - if result.find('Connection refused') != -1: - global isTask - if os.path.exists(isTask): - isStatus = mw.readFile(isTask) - if isStatus == 'True': - return True + # print(version,result) + # 检查openresty + if result.find('Bad Gateway') != -1: + return False + if result.find('HTTP Error 404: Not Found') != -1: + return False - # systemd - systemd = '/lib/systemd/system/openresty.service' - if os.path.exists(systemd): - execShell('systemctl reload openresty') + # 检查Web服务是否启动 + if result.find('Connection refused') != -1: + global isTask + if os.path.exists(isTask): + isStatus = mw.readFile(isTask) + if isStatus == 'True': return True - # initd - initd = '/etc/init.d/openresty' - if os.path.exists(initd): - os.system(initd + ' reload') - return True - except: - return True + + # systemd + systemd = '/lib/systemd/system/openresty.service' + if os.path.exists(systemd): + execShell('systemctl reload openresty') + return True + # initd + initd = '/etc/init.d/openresty' + if os.path.exists(initd): + os.system(initd + ' reload') + return True # --------------------------------------PHP监控 end--------------------------------------------- #