mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 09:13:49 +08:00
@@ -626,7 +626,7 @@ func (v *PHPVhost) PHP() uint {
|
||||
}
|
||||
|
||||
// 从配置内容中提取版本号
|
||||
// 格式: proxy:unix:/run/php-cgi-84.sock|fcgi://localhost/
|
||||
// 格式: proxy:unix:/tmp/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:/run/php-cgi-84.sock
|
||||
// sock 路径格式: unix:/tmp/php-cgi-84.sock
|
||||
content := fmt.Sprintf(`# Auto-generated by AcePanel. DO NOT EDIT MANUALLY!
|
||||
<FilesMatch \.php$>
|
||||
SetHandler "proxy:unix:/run/php-cgi-%d.sock|fcgi://localhost/"
|
||||
SetHandler "proxy:unix:/tmp/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:/run/php-cgi-84.sock|fcgi://localhost/")
|
||||
s.Contains(content, "proxy:unix:/tmp/php-cgi-84.sock|fcgi://localhost/")
|
||||
}
|
||||
|
||||
func (s *VhostTestSuite) TestDefaultVhostConfIncludesServerD() {
|
||||
|
||||
@@ -726,7 +726,7 @@ func (v *PHPVhost) PHP() uint {
|
||||
}
|
||||
|
||||
// 从配置内容中提取版本号
|
||||
// 格式: fastcgi_pass unix:/run/php-cgi-84.sock;
|
||||
// 格式: fastcgi_pass unix:/tmp/php-cgi-84.sock;
|
||||
idx := strings.Index(content, "php-cgi-")
|
||||
if idx == -1 {
|
||||
return 0
|
||||
@@ -746,11 +746,11 @@ func (v *PHPVhost) SetPHP(version uint) error {
|
||||
}
|
||||
|
||||
// 生成 PHP-FPM 配置
|
||||
// sock 路径格式: unix:/run/php-cgi-84.sock
|
||||
// sock 路径格式: unix:/tmp/php-cgi-84.sock
|
||||
content := fmt.Sprintf(`# Auto-generated by AcePanel. DO NOT EDIT MANUALLY!
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
fastcgi_pass unix:/run/php-cgi-%d.sock;
|
||||
fastcgi_pass unix:/tmp/php-cgi-%d.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi.conf;
|
||||
include pathinfo.conf;
|
||||
|
||||
Reference in New Issue
Block a user