Re: PHP from CLI with SAPI

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

 



Fredrik Tolf wrote:

Hi!

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?

Thanks for reading!

Fredrik Tolf
Hi Fredrick,

I wonder too why you are displeased with apache =) to me (and I know
many others in this group) it is the best webserver around.
If you would want to do it (and not use php as a library [SAPI-style] )
you shouldn't look in to CLI, but into CGI.
Using CGI you can lauch a php process every time a script is called.
Many years ago they discovered this isn't the best way to handle this.
To launch a process every time a script is called takes too much time
and resources.
So they invented the FASTCGI interface, which allows php processes to
remain persistant in the memory. You would probably (depending on your
demands) want to have a bunch of php processes forked in the memory.

If it's an experment, I would say go for it. If you want to use it
commercially or at least in a live enviroment I would strongly
discourage you to do it.

In any case, if you want it to be fast, you want to do it 'SAPI-style'..

Enjoy!

Evert

--
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