pull/109/head
Mr Chen 6 years ago
parent 141009be8e
commit ea3c69fe6b
  1. 16
      plugins/php/index.py
  2. 2
      task.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()

@ -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);

Loading…
Cancel
Save