mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 07:57:21 +08:00
feat: 测试修改socket
This commit is contained in:
@@ -626,7 +626,7 @@ func (v *PHPVhost) PHP() uint {
|
||||
}
|
||||
|
||||
// 从配置内容中提取版本号
|
||||
// 格式: proxy:unix:/tmp/php-cgi-84.sock|fcgi://localhost/
|
||||
// 格式: proxy:unix:/run/php-cgi-84.sock|fcgi://localhost/
|
||||
idx := strings.Index(content, "php-cgi-")
|
||||
if idx == -1 {
|
||||
return 0
|
||||
@@ -646,10 +646,10 @@ func (v *PHPVhost) SetPHP(version uint) error {
|
||||
}
|
||||
|
||||
// 生成 PHP-FPM 配置
|
||||
// sock 路径格式: unix:/tmp/php-cgi-84.sock
|
||||
// sock 路径格式: unix:/run/php-cgi-84.sock
|
||||
content := fmt.Sprintf(`# Auto-generated by AcePanel. DO NOT EDIT MANUALLY!
|
||||
<FilesMatch \.php$>
|
||||
SetHandler "proxy:unix:/tmp/php-cgi-%d.sock|fcgi://localhost/"
|
||||
SetHandler "proxy:unix:/run/php-cgi-%d.sock|fcgi://localhost/"
|
||||
</FilesMatch>
|
||||
`, version)
|
||||
|
||||
|
||||
@@ -325,7 +325,7 @@ func (s *VhostTestSuite) TestPHPFilesMatchBlock() {
|
||||
s.NoError(s.vhost.SetPHP(84))
|
||||
|
||||
content := s.vhost.Config("010-php.conf", "site")
|
||||
s.Contains(content, "proxy:unix:/tmp/php-cgi-84.sock|fcgi://localhost/")
|
||||
s.Contains(content, "proxy:unix:/run/php-cgi-84.sock|fcgi://localhost/")
|
||||
}
|
||||
|
||||
func (s *VhostTestSuite) TestDefaultVhostConfIncludesServerD() {
|
||||
|
||||
Reference in New Issue
Block a user