diff --git a/plugins/php/index.py b/plugins/php/index.py index 04a6dda50..aefa7a3c1 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -512,10 +512,10 @@ def setDisableFunc(version): phpini = public.readFile(filename) rep = "disable_functions\s*=\s*.*\n" - phpini = re.sub(rep, 'disable_functions = ' + - disable_functions + "\n", phpini) - public.writeLog('TYPE_PHP', 'PHP_DISABLE_FUNCTION', - (version, disable_functions)) + phpini = re.sub(rep, 'disable_functions = ' +disable_functions + "\n", phpini) + + msg = public.getInfo('修改PHP-{1}的禁用函数为[{2}]',(version, disable_functions,)) + public.writeLog('插件管理[PHP]', msg) public.writeFile(filename, phpini) reload(version) return public.returnJson(True, '设置成功!') @@ -523,13 +523,13 @@ def setDisableFunc(version): def checkPhpinfoFile(v): if public.isInstalledWeb(): - desc_file = public.getServerDir( - ) + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf' - if not os.path.exists(desc_file): + sdir = public.getServerDir() + dfile = sdir + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf' + if not os.path.exists(dfile): tpl = getPluginDir() + '/conf/phpinfo.conf' content = public.readFile(tpl) content = contentReplace(content, v) - public.writeFile(desc_file, content) + public.writeFile(dfile, content) public.restartWeb() diff --git a/task.py b/task.py index ab19795d3..db3b4a531 100755 --- a/task.py +++ b/task.py @@ -386,7 +386,7 @@ def startPHPVersion(version): #尝试重启服务 cgi = '/tmp/php-cgi-'+version + '.sock' pid = sdir+'/php/'+version+'/var/run/php-fpm.pid'; - #os.system('ps -ef | grep php/'+version+' | grep -v grep|grep -v python |awk "{print $2}"|xargs kill') + os.system("ps -ef | grep php/"+version+" | grep -v grep|grep -v python |awk '{print $2}'|xargs kill") time.sleep(0.5); if not os.path.exists(cgi): os.system('rm -f ' + cgi); if not os.path.exists(pid): os.system('rm -f ' + pid);