Re: #!/path/to/php at top of output from CGI
| From: | Jeff Davis | Date: | Fri, 05 Jan 2001 04:31:56 +0000 |
| Subject: | Re: #!/path/to/php at top of output from CGI | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32819@lists.php.net to get a copy of this message | ||
Hmm.. I tried a new extension that shouldn't have anything associated with it
(.pcgi). Also, perl/C work under the .cgi extension. Stranger yet, if I do:
~/www$ ./php.cgi > out
the file 'out' has no '#!/usr/local/bin/php' in it. However if I go to the
browser and execute the CGI thru the webserver it still puts that at the top
(as if it was plaintext, like you said, because it is outside the <??>). Then,
the phpinfo() goes right below it as if nothing was wrong (it outputs fine,
with all the information about php and my environment).
I have the module installed, but I don't think that should make a difference
right?
Thanks very much, it is sort of important that I figure out how to get the CGI
to work.
Jeff Davis
On Thu, 04 Jan 2001, you wrote:
> Then there's probably already a php handler for the extension you have on
> the file so it gets output as plain text, being outside the <? tag
>
> jason
>
> ----- Original Message -----
> From: "Jeff Davis" <jdavis@wasabimg.com>
> To: <php-general@lists.php.net>
> Sent: Friday, January 05, 2001 1:15 PM
> Subject: Re: [PHP] #!/path/to/php at top of output from CGI
>
>
> > Normal CGIs exucute just fine... C or perl or whatever. And I did a
> phpinfo()
> > call and it outputted as normal, just with a '#!/usr/local/bin/php' at the
> top.
> >
> > Thanks,
> > Jeff Davis
> >
> > On Thu, 04 Jan 2001, you wrote:
> > > It sounds like the webserver is not executing it - make sure you have a
> > > ScriptAlias directive for the directory you're trying to put it into. If
> you
> > > don't want it to be restricted to a ScriptAlias'd directory, you'll
> > > need
> to
> > > allow cgi execution outside it with Options ExecCGI. Check the Apache
> manual
> > > to be sure, and be aware of the security implications of running
> executables
> > > outside a ScriptAlias'd directory.
> > >
> > > jason
> > >
> > >
> > > > I compiled a version of php-4.0.4 as a cgi (I already installed a
> module
> > > > version, but I need a CGI too). When I make a file I put
> > > #!/usr/local/bin/php
> > > > at the top and chmod 755 to make it a valid cgi. Then I name it with a
> > > .cgi
> > > >> extension, and put it in the right directory. When I execute it from
> the
> > > shell
> > > > I get normal output, with no #!/usr/local/bin/php anywhere in the
> output.
> > > > However, when I run it as a CGI through a browser, I get a
> > > #!/usr/local/bin/php
> > > > at the top of the output. I have no idea how to make it stop doing
> that,
> > > but I
> > > > need to offer CGI execution for the sake of security (I use suEXEC).
> > > >
> > > > Thanks,
> > > > Jeff Davis
> > > > --
> > > > Jeff Davis
> > > > jdavis@dynworks.com
> > > > http://dynworks.com
> > --
> > Jeff Davis
> > jdavis@dynworks.com
> > http://dynworks.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
--
Jeff Davis
jdavis@dynworks.com
http://dynworks.com