Monday, April 28, 2014

Installing lighttpd, PHP on OpenWRT

I have created this blog post because steps detailed on OpenWRT site did not work.

Installation and initial configurations are same as suggested on OpenWRT site.

1. Install PHP

opkg update
opkg install php5 php5-cgi

2. Instal lighttpd

opkg install lighttpd

3. Edit configuration file /etc/lighttpd/lighttpd.conf as per requirement

You might want to change server.document-root, server.port. Also confirm error log is enabled for debugging.

4. Step to configure PHP with lighttpd was not correct or outdated on http://wiki.openwrt.org/doc/howto/lamp#lighttpd1

Just adding below cgi.assign to configuration file gives duplicate variable error.
cgi.assign = ( ".php"  => "/usr/bin/php-cgi" ) }

First, you should comment cgi.assign entry in /etc/lighttpd/conf.d/10-cgi.conf.

5. And restart lighttpd using: /etc/init.d/lighttpd restart. If everything is configured properly, there should not be any error.

References:
http://wiki.openwrt.org/doc/howto/php
http://wiki.openwrt.org/doc/howto/http.lighttpd

No comments:

Post a Comment