Re: Re: PHP from CLI with SAPI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2005-07-18 at 20:44 +0100, Mikey wrote:
> Catalin Trifu wrote:
> >Fredrik Tolf wrote:
> >>I've begun to be more and more displeased with Apache lately, so I've
> >>been thinking of writing my own HTTP server instead. I still want PHP
> >>support, but writing a new SAPI for PHP seems like overkill.
> >>
> >>Therefore, is it possible to use PHP from the command line, but still
> >>enable some HTTP-server-only stuff, like GET and POST variables,
> >>cookies, session management, file uploads, and so on? I haven't been
> >>able to find any docs on doing that, but I'm thinking that it should be
> >>possible.
> >>
> >>So, can someone either point me to some docs in this, or, lacking such,
> >>give me a short intro to it?
> >
> All of the features you mentioned are those provided for you by Apache, 
> barring the session management.  If you really want to write your own 
> http server then maybe take a look at the Apache source code.  It will 
> either give you some good pointers or make you realise what a huge task 
> you are undertaking...

Are you sure about this? The way I've understood it, the web server just
passes the URL to PHP, and then PHP parses and extracts the GET
variables from it and construct an array of them.

Likewise, surely the server just passes the content passed by the client
browser, and then PHP extracts the POST variables and file uploads,
right? I wouldn't think that Apache extracts POST variables and file
uploads by itself.

Same thing with cookies, right? Surely, the webserver just passes the
headers to PHP, which extracts the cookies, right?

I would think that it should be possible to pass the URL, headers, and
client-passed content to PHP via PHP's CLI interface, to let it do that
job. Isn't that possible?

Even if not, parsing GET URLs and headers doesn't really seem like a
very huge undertaking. I realize that Apache is huge, but that's just
because it has so insanely many features -- an HTTP server in itself
shouldn't need to be very complex, the way I see it.

Thanks for responding!

Fredrik Tolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux