3 ms·
Actually, it's funny you should mention that. I wrote a little web server in PHP that's basically a port of Ruby's Rack: http://github.com/dhotson/kelpie http:
by dhotson 17y ago
Actually, it's funny you should mention that. I wrote a little web server in PHP that's basically a port of Ruby's Rack:
http://github.com/dhotson/kelpie http://github.com/dhotson/kelpie
It actually works pretty well, no apache required! It's pretty fast too.. all the init stuff you normally have to do every single request can be done once on server startup.
I also wrote a little sinatra style framework to go on top of it:
http://github.com/dhotson/kelpie/blob/master/demoapp.php http://github.com/dhotson/kelpie/blob/master/demoapp.php
Anyway, it's turning out to be a pretty fun little project. :-)
- tlrobinson 17y agoCool, I might write up a little library to provide the same interface to standard PHP CGI/Apache.
- dhotson 17y agoThis is what I've got so far: http://gist.github.com/339915 http://gist.github.com/339915 It basically sets all the usual superglobals like $_SERVER, $_GET etc. Doesn't handle sessions just yet; I'm still working on that..
- joshd 17y agoThat's quite cool. That's some of the cleanest PHP I've seen. When I've tried to write long-running applications in PHP I always get memory leaks. How do you handle this in Kelpie?
- dhotson 17y agoThanks Josh! :-D Yeah, it's probably going to have memory leak issues. It's pretty much inevitable unfortunately. I've thought about having the server monitor the memory usage and periodically respawn processes. I believe apache uses a similar technique. I'm open to ideas on this issue though. :-)