This commit is contained in:
parent
3f4f615508
commit
2061d40fcd
|
|
@ -2,7 +2,7 @@ set $PHP_ENV 1;
|
|||
location ~ [^/]\.php(/|$)
|
||||
{
|
||||
try_files $uri =404;
|
||||
fastcgi_pass unix:/tmp/php-cgi-{$PHP_VERSION}.sock;
|
||||
fastcgi_pass unix:/var/opt/remi/php{$PHP_VERSION}/run/php-fpm/www.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi.conf;
|
||||
include {$SERVER_PATH}/web_conf/php/pathinfo.conf;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
location /phpfpm_status_{$PHP_VERSION} {
|
||||
fastcgi_pass unix:/tmp/php-cgi-{$PHP_VERSION}.sock;
|
||||
fastcgi_pass unix:/var/opt/remi/php{$PHP_VERSION}/run/php-fpm/www.sock;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME \$fastcgi_script_name;
|
||||
}
|
||||
|
|
@ -10,7 +10,6 @@ import shutil
|
|||
|
||||
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
|
||||
import mw
|
||||
|
||||
if mw.isAppleSystem():
|
||||
|
|
@ -111,10 +110,13 @@ def contentReplace(content, version):
|
|||
|
||||
|
||||
def makeOpenrestyConf():
|
||||
phpversions = ['00', '52', '53', '54', '55', '56',
|
||||
'70', '71', '72', '73', '74', '80', '81']
|
||||
phpversions = ['00', '74', '80', '81']
|
||||
|
||||
sdir = mw.getServerDir()
|
||||
d_pathinfo = sdir + '/web_conf/php/pathinfo.conf'
|
||||
if not os.path.exists(d_pathinfo):
|
||||
s_pathinfo = getPluginDir() + '/conf/pathinfo.conf'
|
||||
shutil.copyfile(s_pathinfo, d_pathinfo)
|
||||
|
||||
dst_dir = sdir + '/web_conf/php'
|
||||
dst_dir_conf = sdir + '/web_conf/php/conf'
|
||||
|
|
@ -128,11 +130,6 @@ def makeOpenrestyConf():
|
|||
if not os.path.exists(dst_dir_status):
|
||||
mw.execShell('mkdir -p ' + dst_dir_status)
|
||||
|
||||
d_pathinfo = sdir + '/web_conf/php/pathinfo.conf'
|
||||
if not os.path.exists(d_pathinfo):
|
||||
s_pathinfo = getPluginDir() + '/conf/pathinfo.conf'
|
||||
shutil.copyfile(s_pathinfo, d_pathinfo)
|
||||
|
||||
info = getPluginDir() + '/info.json'
|
||||
content = mw.readFile(info)
|
||||
content = json.loads(content)
|
||||
|
|
@ -140,14 +137,14 @@ def makeOpenrestyConf():
|
|||
tpl = getPluginDir() + '/conf/enable-php.conf'
|
||||
tpl_content = mw.readFile(tpl)
|
||||
for x in phpversions:
|
||||
dfile = sdir + '/web_conf/php/conf/enable-php-' + x + '.conf'
|
||||
dfile = sdir + '/web_conf/php/conf/enable-php-yum' + x + '.conf'
|
||||
if not os.path.exists(dfile):
|
||||
w_content = contentReplace(tpl_content, x)
|
||||
mw.writeFile(dfile, w_content)
|
||||
|
||||
# php-fpm status
|
||||
for version in phpversions:
|
||||
dfile = sdir + '/web_conf/php/status/phpfpm_status_' + version + '.conf'
|
||||
dfile = sdir + '/web_conf/php/status/phpfpm_status_yum' + version + '.conf'
|
||||
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
|
||||
if not os.path.exists(dfile):
|
||||
content = mw.readFile(tpl)
|
||||
|
|
@ -155,20 +152,6 @@ def makeOpenrestyConf():
|
|||
mw.writeFile(dfile, content)
|
||||
|
||||
|
||||
def phpFpmReplace(version):
|
||||
desc_php_fpm = getServerDir() + '/' + version + '/etc/php-fpm.conf'
|
||||
if not os.path.exists(desc_php_fpm):
|
||||
tpl_php_fpm = getPluginDir() + '/conf/php-fpm.conf'
|
||||
content = mw.readFile(tpl_php_fpm)
|
||||
content = contentReplace(content, version)
|
||||
mw.writeFile(desc_php_fpm, content)
|
||||
else:
|
||||
if version == '52':
|
||||
tpl_php_fpm = tpl_php_fpm = getPluginDir() + '/conf/php-fpm-52.conf'
|
||||
content = mw.readFile(tpl_php_fpm)
|
||||
mw.writeFile(desc_php_fpm, content)
|
||||
|
||||
|
||||
def phpFpmWwwReplace(version):
|
||||
service_php_fpm_dir = getServerDir() + '/php' + version + '/php-fpm.d/'
|
||||
if not os.path.exists(service_php_fpm_dir):
|
||||
|
|
@ -193,12 +176,8 @@ def getFpmConfFile(version):
|
|||
|
||||
|
||||
def initReplace(version):
|
||||
# makeOpenrestyConf()
|
||||
# makePhpIni(version)
|
||||
|
||||
# phpPrependFile(version)
|
||||
makeOpenrestyConf()
|
||||
phpFpmWwwReplace(version)
|
||||
# phpFpmReplace(version)
|
||||
|
||||
# systemd
|
||||
# mw.execShell('systemctl daemon-reload')
|
||||
|
|
|
|||
Loading…
Reference in New Issue