diff --git a/agent/app/service/runtime_utils.go b/agent/app/service/runtime_utils.go index aa927d83d..dd2dbb5e6 100644 --- a/agent/app/service/runtime_utils.go +++ b/agent/app/service/runtime_utils.go @@ -1018,6 +1018,12 @@ func HandleOldPHPRuntime() { composeContent = strings.ReplaceAll(composeContent, "./extensions:${EXTENSION_DIR}", "./extensions:/usr/local/lib/php/extensions") _ = fileOp.WriteFile(composePtah, strings.NewReader(composeContent), constant.DirPerm) _ = fileOp.WriteFile(runtime.GetFPMPath(), bytes.NewReader(nginx_conf.GetWebsiteFile("php-fpm.conf")), constant.DirPerm) + supervisorConfigPath := path.Join(runtime.GetPath(), "supervisor", "supervisor.d", "php-fpm.ini") + supervisorConfigBytes, _ := fileOp.GetContent(supervisorConfigPath) + if !strings.Contains(string(supervisorConfigBytes), "nodaemonize") { + newConfigContent := strings.ReplaceAll(string(supervisorConfigBytes), "command=php-fpm", "command=php-fpm --nodaemonize") + _ = fileOp.WriteFile(supervisorConfigPath, bytes.NewReader([]byte(newConfigContent)), constant.DirPerm) + } go func() { _ = restartRuntime(&runtime) }() diff --git a/agent/app/service/website_utils.go b/agent/app/service/website_utils.go index 9587a7cb1..5404595da 100644 --- a/agent/app/service/website_utils.go +++ b/agent/app/service/website_utils.go @@ -1136,7 +1136,6 @@ func saveCertificateFile(websiteSSL *model.WebsiteSSL, logger *log.Logger) { func GetSystemSSL() (bool, uint) { sslSetting, err := settingRepo.Get(settingRepo.WithByKey("SSL")) if err != nil { - global.LOG.Errorf("load service ssl from setting failed, err: %v", err) return false, 0 } if sslSetting.Value == "enable" { diff --git a/agent/cmd/server/nginx_conf/php-fpm.conf b/agent/cmd/server/nginx_conf/php-fpm.conf index bcfcfede5..a8019f89b 100644 --- a/agent/cmd/server/nginx_conf/php-fpm.conf +++ b/agent/cmd/server/nginx_conf/php-fpm.conf @@ -4,7 +4,7 @@ log_level = notice [www] user = www-data group = www-data -listen = 127.0.0.1:9000 +listen = 0.0.0.0:9000 pm = dynamic pm.max_children = 10 pm.start_servers = 2 diff --git a/agent/init/migration/migrations/init.go b/agent/init/migration/migrations/init.go index 4e980199c..553fad0d8 100644 --- a/agent/init/migration/migrations/init.go +++ b/agent/init/migration/migrations/init.go @@ -330,7 +330,7 @@ var AddSnapshotRule = &gormigrate.Migration{ }, } var UpdatePHPRuntime = &gormigrate.Migration{ - ID: "20250624-update-php-runtime", + ID: "20250702-update-php-runtime", Migrate: func(tx *gorm.DB) error { service.HandleOldPHPRuntime() return nil