diff --git a/plugins/php-yum/conf/enable-php.conf b/plugins/php-yum/conf/enable-php.conf index 2046ac2cb..9f8461da7 100644 --- a/plugins/php-yum/conf/enable-php.conf +++ b/plugins/php-yum/conf/enable-php.conf @@ -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; diff --git a/plugins/php-yum/conf/phpfpm_status.conf b/plugins/php-yum/conf/phpfpm_status.conf index 4da6f2816..7c8370a27 100644 --- a/plugins/php-yum/conf/phpfpm_status.conf +++ b/plugins/php-yum/conf/phpfpm_status.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; } \ No newline at end of file diff --git a/plugins/php-yum/index.py b/plugins/php-yum/index.py index 838cb5c78..a20ff9317 100755 --- a/plugins/php-yum/index.py +++ b/plugins/php-yum/index.py @@ -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')