List:General Discussion« Previous MessageNext Message »
From:Kelly Yancey Date:August 4 1999 4:12pm
Subject:RE: PHP as CGI script (was: mysql vs. text file)
View as plain text  
> -----Original Message-----
> From: Martin Ramsch [mailto:m.ramsch@stripped]
> Sent: Wednesday, August 04, 1999 2:39 AM
> To: MySQL mailing list
> Subject: PHP as CGI script (was: mysql vs. text file)
>
>
> On Di, 1999-08-03 23:14:47 -0700, Steve Edberg <sbedberg@stripped> wrote:
> > >You just have to compile PHP additionally as CGI script to use it
> > >independant from the web sever.  Works fine, except for some few PHP
> > >features which are only possible as an Apache module (like the
> > >Header() function).
> >
> > I think you meant virtual()...Header() works quite nicely under CGI!
>
> You're right - and I should have look at the PHP manual ... ;)
>
> Apache specific functions are:
>         - apache_lookup_uri
>         - apache_note
>         - getallheaders
>         - virtual
>         - HTTP Authentication hooks (see chapter 16)
>

  I haven't tried this yet, but does php, when compiled as a CGI, now output
HTTP headers if it detects that it being run from the command-line rather
than actually as a CGI? The reason I ask is that any header() calls would
result in the PHP CGI generating HTTP headers in the output stream before
the actual html.
  Of course, the solution would be just not to output HTTP headers :) after
all, we're just talking about using PHP as a template for the actual web
page...so outputting headers would be useless anyway. Same is true with the
Apache (or any other web server) specific functions.
  The rule being:
	if you are generating web pages with PHP, then you can use any function.
	if you are using PHP as a template for generating html files to be served
staticly, then refrain from using any HTTP or web server-specific functions
(such as the functions listed above, Header(), or SetCookie()).

  The only question that still remains is: does php still generate the
Content-Type: text/html header? I can't check until I can compile PHP as a
CGI.

  Kelly
 ~kbyanc@stripped~
  FreeBSD - The Power To Serve - http://www.freebsd.org/
  Join Team FreeBSD - http://www.posi.net/freebsd/Team-FreeBSD



Thread
mysql and excelStuart D Jackson3 Aug
  • Re: mysql and excelSteve Ruby3 Aug
  • RE: mysql and excelMichael Robinson3 Aug
    • mysql and excelFRed3 Aug
    • RE: mysql vs. text fileEe Loon3 Aug
      • Re: mysql vs. text fileChristian Mack3 Aug
      • RE: mysql vs. text fileKelly Yancey4 Aug
        • Re: mysql vs. text fileMartin Ramsch4 Aug
          • Re: mysql vs. text fileSteve Edberg4 Aug
            • PHP as CGI script (was: mysql vs. text file)Martin Ramsch4 Aug
              • RE: PHP as CGI script (was: mysql vs. text file)Kelly Yancey4 Aug
                • Locking problem?Arlen Greer4 Aug
                  • Re: Locking problem?Patrick Sherrill4 Aug
                    • RE: Locking problem?Arlen Greer5 Aug
                      • Re: Locking problem?Christian Mack5 Aug
RE: mysql and excelWilliam D. Webber3 Aug
Re: mysql and excelRalph Graulich4 Aug
RE: Locking problem?Quentin Bennett5 Aug