This commit is contained in:
Mr Chen
2024-06-13 21:22:35 +08:00
parent 4bd78541fc
commit 4df1555179
2 changed files with 15 additions and 2 deletions
+5
View File
@@ -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
+10 -2
View File
@@ -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)