CC: | s.priebe [...] profihost.ag |
Subject: | Failure in CGI/FCGI detection |
Opening this as a ticket because it might need further discussion.
Currently the detection mechanism looks like this:
Web/Simple/Application.pm
if (
$ENV{PHP_FCGI_CHILDREN} || $ENV{FCGI_ROLE} || $ENV{FCGI_SOCKET_PATH}
|| -S STDIN # STDIN is a socket, almost certainly FastCGI
) {
return $self->_run_fcgi;
} elsif ($ENV{GATEWAY_INTERFACE}) {
return $self->_run_cgi;
[...]
However on our servers STDIN is a socket even for scripts accessed as
CGI. There is however still a reliable way to detect them being run as
CGI scripts, since %ENV contains this:
'GATEWAY_INTERFACE' => 'CGI/1.1',
From what i can tell, the GATEWAY_INTERFACE env variable is set only
for CGI, so pulling that check to the front of the if-chain should fix
this. Are there any issues with this that i overlooked?