Posts: 22
Joined: Sat Feb 13, 2016 6:13 am

Can't install lighttpd after routine install. Related to php5->7?

Thu Oct 11, 2018 4:03 am

I am reinstalling my Raspbian system and everything is working well and easily . . . except lighttpd support.

It appears that the fastcgi just isn't installing.

Error log, consistently, says:

2018-10-10 20:48:49: (log.c.217) server started
2018-10-10 20:48:49: (mod_fastcgi.c.1478) invalid "bin-path" => "/usr/bin/php-cgi" (check that file exists, is regular file, and is executable by lighttpd)
2018-10-10 20:48:49: (mod_fastcgi.c.1159) the fastcgi-backend /usr/bin/php-cgi failed to start:
2018-10-10 20:48:49: (mod_fastcgi.c.1163) child exited with status 2 /usr/bin/php-cgi
2018-10-10 20:48:49: (mod_fastcgi.c.1166) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.\nIf this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2018-10-10 20:48:49: (mod_fastcgi.c.1518) [ERROR]: spawning fcgi failed.
2018-10-10 20:48:49: (server.c.1269) Configuration of plugins failed. Going down

Config file seems a bit bare:

server.modules = (

server.document-root = "/var/www/html"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log" = "/var/run/"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80

index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir = "/var/cache/lighttpd/compress/"

Yet, when I try to enable the "fast cgi" stuff, via:

sudo lighty-enable-mod fastcgi-php

. . .it tells me it is already enabled (and, despite the spartan file above, this seems likely as the error log seems to say I failed to spawn it).

I cannot detect /usr/bin/php-cgi or anything like it, either.

I did the upgrade/update thing and I even uninstalled lighttpd and php7.0 and reinstalled them (including the -fpm package).

What do I do from here? I do not fancy manually editing the config file and I have not had to before. I used to be able to do this back in the php5 days easily, but instructions for the php7 timeframe are contradictory and seem to vary over time.

What do I do now?

Posts: 2431
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Can't install lighttpd after routine install. Related to php5->7?

Fri Oct 12, 2018 7:58 pm

"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Networking and servers”