diff --git a/plugins/php/index.py b/plugins/php/index.py index 27b79f3ab..b5fb5c676 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -446,21 +446,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, '设置成功!') diff --git a/plugins/php/init.d/php52.tpl b/plugins/php/init.d/php52.tpl index 2daa4a78d..49b94dba4 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/log/php-fpm.pid php_opts="--fpm-config $php_fpm_CONF"