Lighttpd Web Server with PHP Support through Optware-NG

1 - Install Optware-NG from here

2 - Update optware-ng

ipkg update
ipkg upgrade

3 - Install lighttpd

ipkg install lighttpd

4 - Change server port from 8081 to 81

sed -i 's/server.port                = 8081/server.port                = 81/g' "/opt/etc/lighttpd/lighttpd.conf"

5 - Start server

/opt/etc/init.d/S80lighttpd restart

6 - Go to and if you see this page, the lighttpd web server is configured correctly

7 - Create php info page

cat >> /opt/share/www/info.php << EOF


8 - Install PHP

ipkg install php php-fcgi

9 - Restart server

/opt/etc/init.d/S80lighttpd restart

10 - Go to and if you see this page, php is configured correctly

11 - Enable access from wan

nano /jffs/scripts/firewall-start

Paste this lines

iptables -I INPUT -p tcp --destination-port 81 -j ACCEPT
Save with CTRL-O / Enter / and exit with CTRL-X
Make script executable and apply rule
chmod a+rx /jffs/scripts/firewall-start

12 - Go to Port Forwarding page and redirect port 80 to 81



  • Tanaka

    Step. 10 in page, I got "500 - Internal Server Error"

    • Clear cookies, reboot router and/or use another browser.

  • Mario

    mysql php not contain only contain and sqlitei.pdo

  • Yoric

    Where can I get

    2016-07-09 19:02:20: (log.c.166) server started
    2016-07-09 19:02:20: (mod_fastcgi.c.1103) the fastcgi-backend /opt/bin/php-fcgi failed to start:
    2016-07-09 19:02:20: (mod_fastcgi.c.1107) child exited with status 16 /opt/bin/php-fcgi
    2016-07-09 19:02:20: (mod_fastcgi.c.1110) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
    If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
    2016-07-09 19:02:20: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi failed.
    2016-07-09 19:02:20: (server.c.964) Configuration of plugins failed. Going down.

    php-fcgi -v
    /tmp/mnt/Photo/optware-ng/bin/php-fcgi: can't load library ''

    ldd php-fcgi => /opt/lib/ (0x2aac0000) => /opt/lib/ (0x2aad4000) => /opt/lib/ (0x2aafc000) => /opt/lib/ (0x2ab35000) => /opt/lib/ (0x2ab59000) => /opt/lib/ (0x2aca8000) => not found => /opt/lib/ (0x2acd6000) => /opt/lib/ (0x2ae41000) => /opt/lib/ (0x2ae69000) => /opt/lib/ (0x2af59000) => /opt/lib/ (0x2aaa8000)

    ipkg install lighttpd
    Package lighttpd (1.4.32-1) installed in /opt/ is up to date.

    ipkg install php php-fcgi
    Package php (5.6.19-1) installed in /opt/ is up to date.
    Package php-fcgi (5.6.19-1) installed in /opt/ is up to date.

    • Yoric

      /lib# ln -s

  • Incognito Psytrancer

    Pleace help!!! optware-ng.arm/bin/motion: can't load library '' !!!

    • Incognito Psytrancer

      SOLVED run motion:

      lib/ ln -s

      ipkg install xz-utils


To be notified by email when a new tutorial is posted :)

Thanks for Subscribing! I'll keeping you up-to-date with latest tutorials!

Something went wrong, try again...