This commit is contained in:
Mr Chen
2018-12-18 19:43:41 +08:00
parent 4dc2828c59
commit d694af9358
2 changed files with 13 additions and 4 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
[www]
user = www
group = www
user = {$PHP_USER}
group = {$PHP_GROUP}
listen = /tmp/php-cgi-{$PHP_VERSION}.sock
pm = dynamic
pm.max_children = 5
+11 -2
View File
@@ -15,7 +15,7 @@ sys.path.append(os.getcwd() + "/class/core")
import public
app_debug = False
if public.getOs() == 'darwin':
if public.isAppleSystem():
app_debug = True
@@ -72,6 +72,15 @@ def contentReplace(content, version):
service_path = public.getServerDir()
content = content.replace('{$SERVER_PATH}', service_path)
content = content.replace('{$PHP_VERSION}', version)
if public.isAppleSystem():
user = public.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
content = content.replace('{$PHP_USER}', user)
content = content.replace('{$PHP_GROUP}', 'staff')
else:
content = content.replace('{$PHP_USER}', 'www')
content = content.replace('{$PHP_GROUP}', 'www')
return content
@@ -89,7 +98,7 @@ def makeOpenrestyConf():
tpl = getPluginDir() + '/conf/enable-php.conf'
tpl_content = public.readFile(tpl)
for x in range(len(versions)):
w_content = tpl_content.replace('{$PHP_VERSION}', versions[x])
w_content = contentReplace(tpl_content, versions[x])
desc_file = public.getServerDir() + '/openresty/nginx/conf/enable-php-' + \
versions[x] + '.conf'
if not os.path.exists(desc_file):