diff --git a/plugins/php-apt/conf/php-fpm.conf b/plugins/php-apt/conf/php-fpm.conf new file mode 100644 index 000000000..07308141a --- /dev/null +++ b/plugins/php-apt/conf/php-fpm.conf @@ -0,0 +1,5 @@ +[global] +pid = /run/php/php{$PHP_VERSION}-fpm.pid +error_log = /var/log/php{$PHP_VERSION}-fpm.log +include=/etc/php/{$PHP_VERSION}/fpm/pool.d/*.conf +php_value[auto_prepend_file]={$SERVER_PATH}/php/app_start.php \ No newline at end of file diff --git a/plugins/php-apt/index.py b/plugins/php-apt/index.py index 134bf2d6b..9d47e0ec1 100755 --- a/plugins/php-apt/index.py +++ b/plugins/php-apt/index.py @@ -72,8 +72,7 @@ def getFpmFile(version): def status(version): # ps -ef|grep 'php/81' |grep -v grep | grep -v python | awk '{print $2} - cmd = "ps -ef|grep 'php/" + version + \ - "' |grep -v grep | grep -v python | awk '{print $2}'" + cmd = "ps -ef|grep 'php/" + version + "' |grep -v grep | grep -v python | awk '{print $2}'" data = mw.execShell(cmd) if data[0] == '': return 'stop' @@ -170,6 +169,15 @@ def deleteConfList(version): if os.path.exists(enable_conf): os.remove(enable_conf) +def phpFpmReplace(version): + desc_php_fpm = getServerDir() + '/' + version + '/fpm/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) + return True + def initReplace(version): makeOpConf(version)