[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Webrick serving php pages?

Marc Heiler

7/29/2006 3:12:00 PM

I carry many .php pages, but I mostly write in Ruby these days.

My question is if webrick could be used to serve php pages.

Right now I use apache, but I want to be flexible and become less
dependant on apache. (Actually, that apache sends the pages to the php
interpreter, is pretty much the only reason I use apache).


Is it possible to send .php pages to the php parser, and have webrick
serve the resulting html "string" to the "visitor"? ("Visitor" because
these pages arent really for everyone, its mostly a local faq for me
which i wrote in php some years ago)

--
Posted via http://www.ruby-....

2 Answers

Jano Svitok

7/29/2006 3:54:00 PM

0

On 7/29/06, Marc Heiler <shevegen@linuxmail.org> wrote:
> I carry many .php pages, but I mostly write in Ruby these days.
>
> My question is if webrick could be used to serve php pages.
>
> Right now I use apache, but I want to be flexible and become less
> dependant on apache. (Actually, that apache sends the pages to the php
> interpreter, is pretty much the only reason I use apache).

It should be possible to use command line php (php.exe on win)
together with WEBrick::CGIHandler:

http://microjet.ath.cx/webrickguide/html/CGIHa...

That way, you'll call your php scripts as .../cgi/php.cgi/tada.php?fsgsdfg
(or similar, I haven't tried)

Additionally, you can write PHPHandler < CGIHandler, that will call
php for you, and add it to the FileHandler configuration
(:HandlerTable,
http://microjet.ath.cx/webrickguide/html/FileHandler_Configur...)

Anyway, I expect it to be pretty slow, as php will be started each
time anew. Try, and you'll see. (It'd be nice if you'd post your
findings, as I haven't done this and I'm curious)

HTH,
Jano

Matt Todd

7/29/2006 5:31:00 PM

0

Mongrel's plugin support will be available soon, and I'm going to take
a shot at getting a PHP interpreter working with that, but as for
right now, your best bet is to look up NanoWeb. It's a mini webserver
written in PHP, much like Webrick is to Ruby. It seems to perform very
well. If nothing else, you can configure it on a different port and do
some form of proxying to that port for getting the PHP pages served.

M.T.