Re: Re: PHP/CGI problem: #!/path/php at top of CGI scriptappears in output

From: Date: Tue, 30 Oct 2001 21:24:24 +0000
Subject: Re: Re: PHP/CGI problem: #!/path/php at top of CGI scriptappears in output
References: 1  Groups: php.general php.install 
Request: Send a blank email to php-general+get-72927@lists.php.net to get a copy of this message
Heya, I've run into this in the past as well. Unfortunately there doesn't currently appear to be any way to work around it that, in my case, seemed reasonable. I think the essence of it is that the design team has apparently made a choice that the entire file will be passed to the interpreter just as it would if called as a module. Unfortunately this means, unlike many other scripted languages # isn't seen as a comment line. There really isn't an elegant way around it, I can understand why this isn't appealing to them. So, you are left with few choices. Use .htaccess or use php <filename>. That of course doesn't help with suexec. The only alternative I see is to wrap the script with a bit of c code that execs php on the desired file. And if you are going to do that you don't really need suexec anyhow. It is an annoying problem. I personally would not be all that bothered if the first line of a file were treated differently then the rest and the #! were checked for along with any cmd line options that might be on it. It would be nice to be able to run the same script via cgi or the module or on the command line without having to invoke it as php <filename>. ________________________________________________________________________ Darren Henderson darren@bmv.state.me.us darren.henderson@state.me.us

« previous php.general (#72927) next »