mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-09 23:17:21 +08:00
fix: Resolve the php runtime start failed (#9369)
This commit is contained in:
parent
e10b19bcde
commit
94d37eb68a
4 changed files with 8 additions and 3 deletions
|
@ -1018,6 +1018,12 @@ func HandleOldPHPRuntime() {
|
||||||
composeContent = strings.ReplaceAll(composeContent, "./extensions:${EXTENSION_DIR}", "./extensions:/usr/local/lib/php/extensions")
|
composeContent = strings.ReplaceAll(composeContent, "./extensions:${EXTENSION_DIR}", "./extensions:/usr/local/lib/php/extensions")
|
||||||
_ = fileOp.WriteFile(composePtah, strings.NewReader(composeContent), constant.DirPerm)
|
_ = fileOp.WriteFile(composePtah, strings.NewReader(composeContent), constant.DirPerm)
|
||||||
_ = fileOp.WriteFile(runtime.GetFPMPath(), bytes.NewReader(nginx_conf.GetWebsiteFile("php-fpm.conf")), 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() {
|
go func() {
|
||||||
_ = restartRuntime(&runtime)
|
_ = restartRuntime(&runtime)
|
||||||
}()
|
}()
|
||||||
|
|
|
@ -1136,7 +1136,6 @@ func saveCertificateFile(websiteSSL *model.WebsiteSSL, logger *log.Logger) {
|
||||||
func GetSystemSSL() (bool, uint) {
|
func GetSystemSSL() (bool, uint) {
|
||||||
sslSetting, err := settingRepo.Get(settingRepo.WithByKey("SSL"))
|
sslSetting, err := settingRepo.Get(settingRepo.WithByKey("SSL"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
global.LOG.Errorf("load service ssl from setting failed, err: %v", err)
|
|
||||||
return false, 0
|
return false, 0
|
||||||
}
|
}
|
||||||
if sslSetting.Value == "enable" {
|
if sslSetting.Value == "enable" {
|
||||||
|
|
|
@ -4,7 +4,7 @@ log_level = notice
|
||||||
[www]
|
[www]
|
||||||
user = www-data
|
user = www-data
|
||||||
group = www-data
|
group = www-data
|
||||||
listen = 127.0.0.1:9000
|
listen = 0.0.0.0:9000
|
||||||
pm = dynamic
|
pm = dynamic
|
||||||
pm.max_children = 10
|
pm.max_children = 10
|
||||||
pm.start_servers = 2
|
pm.start_servers = 2
|
||||||
|
|
|
@ -330,7 +330,7 @@ var AddSnapshotRule = &gormigrate.Migration{
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
var UpdatePHPRuntime = &gormigrate.Migration{
|
var UpdatePHPRuntime = &gormigrate.Migration{
|
||||||
ID: "20250624-update-php-runtime",
|
ID: "20250702-update-php-runtime",
|
||||||
Migrate: func(tx *gorm.DB) error {
|
Migrate: func(tx *gorm.DB) error {
|
||||||
service.HandleOldPHPRuntime()
|
service.HandleOldPHPRuntime()
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Reference in a new issue