Project

General

Profile

Does Lighttpd support Fastcgi only?

Added by fastcgi almost 13 years ago

Hi guys,

I am using embedded linux for lighttpd.
I have compiled and installed into arm-linux.

I wanna configure it to support php. I add cgi module to module.conf.
and modified cgi.module to support .php and specified my php interpreter php-cgi.

after that I start lighttpd and from its log, i am sure it starts.

but the problem is I cannot access php from remote client.

Should I config for fastcgi? actually I really don't need fastcgi.
--------------
OS: arm linux
lighttpd: 1.4.28
PHP: 5.3.6


Replies (3)

RE: Does Lighttpd support Fastcgi only? - Added by spaam almost 13 years ago

you can use cgi . . you can find info about that on the wiki :)

RE: Does Lighttpd support Fastcgi only? - Added by fastcgi almost 13 years ago

hi spaam.

Yes I did.

After I enable debug handling, I got this line from error.log
(mod_staticfile.c.392) -- NOT handling file as static file, extension forbidden

I found the error happened when it did buffer_is_equal_right_len() function. it tried to check if the rightmost bytes of the string are equal.

and then I modified mod_staticfile to check out what happened, I add the following lines to mod_staticfile line88
log_error_write(srv, FILE, LINE, "sb", "buffer1 :", con->physical.path);
log_error_write(srv, FILE,__LINE__,"sb", "buffer2 :", ds->value);
log_error_write(srv, FILE,__LINE__,"sx", "len :", ds->value->used - 1);

then I put http://192.168.30.110/update.php to my browser, the output like this,

(mod_staticfile.c.388) buffer1 : /usr/www/htdocs/update.php
(mod_staticfile.c.389) buffer2 : .php
(mod_staticfile.c.389) len : 0x04

so the error happend at buffer.c

607     if (0 == strncmp(b1->ptr + b1->used - 1 - len,
608 b2->ptr + b2->used - 1 - len, len)) {
609 return 1;
610 }

here the compare the sufix of the file, it's ".php" and then it find the two strings are equal then return 1
and then buffer_is_equal_right_len() return 1, and then I got extension forbidden.
Why?

RE: Does Lighttpd support Fastcgi only? - Added by fastcgi almost 13 years ago

solved....

in document root directory,
for php cgi, have to
mkdir php-cgi
and put all the web files into the directory.

    (1-3/3)