[BusyBox] Question about PHPwith busybox

Rory Vieira rory.vieira at coolview.nl
Fri Nov 12 12:24:36 UTC 2004


Hi,

> > I am interested in using PHP with the busybox httpd. I
> looked through
> > the mailing list archives and saw a post from Florian
> Schirmer about a
> > patch to allow this, but I when I had a quick look at my busybox
> > source code I did not see any sign that the patch had been
> applied (I
> > believe I have RC3). Is it possible to use php with the
> busybox httpd
> > and if so, where do I get the equivalent of the apache
> modphp.so and
> > how do I configure it?
>
> The "equivalent" would be a php CGI. You get it by compiling
> php for cgi (option of configure-script). You'll have to
> convince the php app (and that's probably what that patch is
> for) that it is indeed running as a CGI. I still don't know
> how PHP works in CGI mode, i tried it myself and it ended in
> the fact that the php CGI searched for some (non-standard)
> CGI environment variable which wasn't set and then denied to
> run as CGI (saying something like "broken gateway", IIRC).


I have been messing about with this for quite some time, as I was
interested in replacing Perl as the defacto standard on my linux system.

However, what Hans suggested isn't quite true.

My prelimenary tests with php were not with the CGI executable, as it
didn't work for me.
It kept spitting errors abount not being able to find an input file ?!?
I ended up using the cli version, which works perfectly...

This all does have it's troubles when trying to run them...
Eg naming the files '.php' doesn't help, as busybox doesn't know what to
do with them...
So in order to get them executed, I have done the following:

---snip---
#!/bin/php
<html>
<head><title></title></head>
<body>
<? phpinfo() ?>
</body>
</html>
---snip---

I named the file foo.cgi, and it does work this way.

I anyone has a different method of calling php I'd like to know.
It would be great if the httpd can understand it should run another
binary than
what's stated in the shabang...

Cheers,
Rory Vieira
The Cool View

rory dot vieira at coolview dot nl
http colon slash slash www dot coolview dot nl





More information about the busybox mailing list