Update index.py
This commit is contained in:
parent
f81d598fcf
commit
53055bbdef
|
|
@ -563,6 +563,10 @@ def setSessionConf(version):
|
|||
val = r'session.save_handler = ' + save_handler + '\n'
|
||||
phpini = re.sub(rep, val, phpini)
|
||||
|
||||
content = mw.execShell(
|
||||
'cat /etc/php/' + version + '/fpm/conf.d/*' + " | grep -v '^;' |tr -s '\n'")
|
||||
content = content[0]
|
||||
|
||||
if save_handler == "memcached":
|
||||
if not re.search("memcached.so", phpini):
|
||||
return mw.returnJson(False, '请先安装%s扩展' % save_handler)
|
||||
|
|
@ -575,7 +579,7 @@ def setSessionConf(version):
|
|||
'\n;session.save_path = "' + session_tmp + '"' + val, phpini)
|
||||
|
||||
if save_handler == "memcache":
|
||||
if not re.search("memcache.so", phpini):
|
||||
if not content.find('memcache') > -1:
|
||||
return mw.returnJson(False, '请先安装%s扩展' % save_handler)
|
||||
rep = r'\nsession.save_path\s*=\s*(.+)\r?\n'
|
||||
val = r'\nsession.save_path = "%s:%s" \n' % (ip, port)
|
||||
|
|
@ -586,7 +590,7 @@ def setSessionConf(version):
|
|||
'\n;session.save_path = "' + session_tmp + '"' + val, phpini)
|
||||
|
||||
if save_handler == "redis":
|
||||
if not re.search("redis.so", phpini):
|
||||
if not content.find('redis') > -1:
|
||||
return mw.returnJson(False, '请先安装%s扩展' % save_handler)
|
||||
if passwd:
|
||||
passwd = "?auth=" + passwd
|
||||
|
|
|
|||
Loading…
Reference in New Issue