Webrick serving php pages?

M

Marc Heiler

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

Jan Svitok

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/CGIHandler.html

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_Configuration.html)

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
 
M

Matt Todd

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top