1

I have 2 php fpm services in my server, one is php 5.6 in port 9001, and the other is php 7.2 in port 9072.

I have a website that is running on PHP 5.6, working using the following config:

fastcgi.server += ( ".php" =>
        ((
                "host" => "127.0.0.1",
                "port" => "9001",
                "broken-scriptfilename" => "enable"
        ))
)

I want a subdomain to work with php 72, currently it configured like that:

###### Subdomain settings ##############
$HTTP["host"]  == "dev.mydomain.net"{
        server.document-root = "/var/www/lighttpd/dev"
}

but when I add:

server.port = "9072"

my lighttpd service fail to start after restart.

Any idea what could have gone wrong? My logs say nothing about it.

2020-04-15 10:31:23: (server.c.1521) server started (lighttpd/1.4.54) 
2020-04-15 10:31:23: (server.c.1550) WARNING: unknown config-key: alias.url (ignored) 
TheUnreal
  • 111
  • 2

1 Answers1

1

You can configure lighttpd to run multiple fastcgi servers and to send traffic to one or the other based on conditions.

fastcgi.server += ( ".php" =>
        ((
                "host" => "127.0.0.1",
                "port" => "9001",
                "broken-scriptfilename" => "enable"
        ))
)

$HTTP["host"]  == "dev.mydomain.net"{
        server.document-root = "/var/www/lighttpd/dev"
        fastcgi.server += ( ".php" =>
                ((
                        "host" => "127.0.0.1",
                        "port" => "9072",
                        "broken-scriptfilename" => "enable"
                ))
        )
}
gstrauss
  • 151
  • 3