OpenWrt Forum Archive

Topic: yet another lighttpd + php5 question

The content of this topic has been archived on 6 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

hey,
i succesfully installed lighttpd on my wrt54gl. then i wanted to use php, so I installed additional packages:

lighttpd-mod-cgi
php5
php5-cgi

I used this howto http://forum.openwrt.org/viewtopic.php?id=10330
But when I try to view the phpinfo-page I get "500 - Internal Server Error".
logread says the following:

Apr 25 19:26:48 OpenWrt user.info : 2007-04-25 17:26:48: (mod_cgi.c.961) CGI failed: No such file or directory /usr/bin/php
Apr 25 19:26:48 OpenWrt user.info : mod_cgi.c.964: aborted

this is weird because /usr/bin/php is definately there (symlinked to my mmc):

root@OpenWrt:~# ls -la /usr/bin/php
lrwxrwxrwx    1 root     root           16 Apr 25 19:28 /usr/bin/php -> /mmc/usr/bin/php

whats wrong here?
thanks

(Last edited by openwrt on 25 Apr 2007, 18:43)

So, you installed lighttpd and php5 packages on your MMC card, right?

- which filesystem are you using on your MMC card?
- did you set the correct LD_LIBRARY_PATH variable? (see http://wiki.openwrt.org/PackagesOnExternalMediaHowTo)
- from where did you installed the lighttpd and php5 package binaries or did you compiled them by yourself?

(Last edited by forum2006 on 25 Apr 2007, 19:23)

thanks for your answer. yes all the packages are on my mmc.

- which filesystem are you using on your MMC card?

my mmc card has ext2 filesystem

- did you set the correct LD_LIBRARY_PATH variable? (see http://wiki.openwrt.org/PackagesOnExternalMediaHowTo)

here is the part from the /etc/profile
It should be correct I think:

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/mmc/bin:/mmc/sbin:/mmc/usr/bin:/mmc/usr/sbin
export LD_LIBRARY_PATH=/lib:/usr/lib:/mmc/lib:/mmc/usr/lib

- from where did you installed the lighttpd and php5 package binaries or did you compiled them by yourself?

I did not compile the packages, I used the 0.9-backports repository (http://downloads.openwrt.org/backports/0.9/)

The symlinks were set by this howto Point 4.3 (http://wiki.openwrt.org/UsbStorageHowto … C%28usb%29)
I dunno what should be wrong....? What else can I do, to make it work?

Thanks

(Last edited by openwrt on 25 Apr 2007, 20:03)

I think you don't need to symlink the files.

The other option is to backport (compile) lighttpd and php5 packages by yourself using the WR SDK and the Kamikaze packages repository. In the replys to my howto Oconner got it working after recompiling.

(Last edited by forum2006 on 25 Apr 2007, 20:06)

Ok, thank you so far.
I'll try to compile the packages, though I've never done this (is there a howto? I'm quite new to embedded linux systems...)
btw, it doesn't even work without symlinking the files, so that's not the failure.

Sorry, can't help you further, because backporting seems broken sad

If you like this feature switch to Kamikaze.

hello forum2006,
I now switched to kamikaze and compiled all necessary packages by myself. I installed the packages regarding your howto onto my mmc and correctly set the LD_LIBRARY_PATH.
But I get the same error:

2007-04-30 13:27:08: (mod_cgi.c.703) stat for cgi-handler /mmc/usr/bin/php failed: No such file or directory

I am really confused and I don't know what else I can do????
any help is appreciated!

:EDIT:
I just tried to install lighttpd and php5 packages to root (not to mmc), but even then I get the same error messages.
I am desperate.

(Last edited by openwrt on 30 Apr 2007, 17:10)

This might sound  a bit silly, but check your /etc/lighttpd.conf file for your cgi settings; make sure that it points to the actual PHP binary itself (and this should be the PHP CGI binary, not the CLI for fast-cgi version). Also make sure that the server.document-root setting in that config file is valid and points to a directory that actually exists and is readable.

Thanks for your hints, but I've already checked all that twice. Unfortunately I couldn't get php-cgi to work, so that I switched to php-fastcgi now, which works on the first try. after all that trouble I am now happy that I have a working php webserver.
thank you,
bye

(Last edited by openwrt on 3 May 2007, 23:53)

The discussion might have continued from here.