diff --git a/plugins/php/index.py b/plugins/php/index.py index fe6be8eca..5a0758c00 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -537,6 +537,10 @@ def checkFpmStatusFile(version): def getFpmStatus(version): checkFpmStatusFile(version) + stat = status(version) + if stat == 'stop': + return mw.returnJson(False, 'PHP[' + version + ']未启动!!!') + try: url = 'http://' + mw.getHostAddr() + '/phpfpm_status_' + version + '?json' result = mw.httpGet(url) @@ -552,7 +556,7 @@ def getFpmStatus(version): except Exception as e: data = {} - return mw.getJson(data) + return mw.returnJson(True, "OK", data) def getDisableFunc(version): diff --git a/plugins/php/js/php.js b/plugins/php/js/php.js index 6b556ec53..692cbdabe 100755 --- a/plugins/php/js/php.js +++ b/plugins/php/js/php.js @@ -312,7 +312,13 @@ function setFpmConfig(version){ function getFpmStatus(version){ phpPost('get_fpm_status', version, '', function(ret_data){ - var rdata = $.parseJSON(ret_data.data); + var tmp_data = $.parseJSON(ret_data.data); + if(!tmp_data.status){ + layer.msg(tmp_data.msg, { icon: tmp_data.status ? 1 : 2 }); + return; + } + + var rdata = tmp_data.data; var con = "
\ \ \ diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 016f7af6a..0517c505f 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -184,6 +184,9 @@ case "$1" in 'restart_panel') mw_stop_panel mw_start_panel;; + 'restart_task') + mw_stop_task + mw_start_task;; 'status') mw_status;; 'logs') error_logs;; 'default')
应用池(pool)" + rdata.pool + "
进程管理方式(process manager)" + ((rdata['process manager'] == 'dynamic') ? '动态' : '静态') + "