> If this is indeed a use-case for CGI then I think it's a valid argument
> and we are probably better off supporting it. I did not remember shebang
> works for real CGI.
> There are still plenty of use-cases for running CGI (as opposed to
> FastCGI) in the industry.
> Question now is whether this should be done in the scanner or in the
> SAPI.  I'll check with Dmitry who made this change.
>
> Andi

yes, some servers are still running php as CGI. But it is not only CGI 
standard involved.

Well, to have a script running as a CGI, shell is executed. That's why it's 
necessary to have execute file permissions, that's why shebang looks like 
any other shell shebangs:
#!whateverhandler whateverargument
In other words, shebangs are SHELL INSTRUCTIONS and have nothing to do with 
CGI at all, or more precisely CGI is just one case where shebang is useful.
With shebang any php script can be run via shell, as if it was an 
executable, so it is useful, not only in case of CGI.

As I see it, the problem stems from fact that shebangs in php scripts are 
always located in the HTML part. Otherwise they would be ignored by PHP as 
regular comments and no problems would arise. So, special handling should be 
done in  PHP to IGNORE shebangs.
Better to have this done in lexer. Why? Because the same scripts can be run 
using cron (via shell), apache module, console (via shell), and CGI.

just my 2c.

-jv 



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to