lighttpd forum lighty > Put php4 and php5 as fastcgi at the same time

Posted by Xavier dutoit (Guest)
on 08.08.2006 08:56
Hello,

So far I've been able to run either php4:

fastcgi.server    = ( ".php" =>
        ((
                "bin-path" => "/usr/bin/php4-cgi",
                "socket" => "/tmp/php.socket",
                "max-procs" => 1,
                "idle-timeout" => 20,
                "bin-environment" => (
                        "PHP_FCGI_CHILDREN" => "1",
                        "PHP_FCGI_MAX_REQUESTS" => "10000"
                ),
                "bin-copy-environment" => (
                        "PATH", "SHELL", "USER"
                ),
                "broken-scriptfilename" => "enable"
        ))

or php5 (changing the bin-path)

I'd like to be able to have two fastcgi server running on the same 
machine and on each vhost, being able to say which one to use.

I don't want to have one fastcgi server per vhost, but having some of 
them using php5 (one fastcgi server) and some others php4 (the other 
fastcgi server).

I searched your site but didn't find how to do it. Any suggestion or 
pointer more than welcome.

Thanks in advance,

Xavier
Posted by Jan Kneschke
on 08.08.2006 11:42
Xavier dutoit wrote:
> Hello,
> 
> I'd like to be able to have two fastcgi server running on the same 
> machine and on each vhost, being able to say which one to use.
> 
> I don't want to have one fastcgi server per vhost, but having some of 
> them using php5 (one fastcgi server) and some others php4 (the other 
> fastcgi server).
> 
> I searched your site but didn't find how to do it. Any suggestion or 
> pointer more than welcome.

fastcgi.server = (
  ".php5" => ...,
  ".php4" => ....
)

$HTTP["host"] == "www1.example.org" {
  fastcgi.max-extension = ( ".php"  => ".php5" )
}

$HTTP["host"] == "www2.example.org" {
  fastcgi.max-extension = ( ".php"  => ".php4" )
}

> Thanks in advance,
> 
> Xavier

Jan
Posted by Xavier dutoit (Guest)
on 08.08.2006 14:21
> 
> $HTTP["host"] == "www2.example.org" {
>   fastcgi.max-extension = ( ".php"  => ".php4" )
> }

On my debian, it says when starting the server :
(server.c.857) WARNING: unknown config-key: fastcgi.max-extension 
(ignored)

On the documentation, you mention another config-key that looks that 
does the same:
http://www.lighttpd.net/documentation/fastcgi.html

so I put
 fastcgi.map-extensions = ( ".php"  => ".php4" )

and it seems to work really well.

Thanks.

Xavier
Posted by Andrew (Guest)
on 08.08.2006 18:53
I think that was just a typo.