Hey guys, I can't figure this out, when I add the fastcgi module to lighttpd when I try to connect to a php page, I get a segmentation fault error. Nothing is in the error log, and nothing else is printed on the crash. It seems to only be a problem with php pages; if I connect to an html page, while the fastcgi module is on, the server doesn't crash. Also, I get a Error 324 (net::ERR_EMPTY_RESPONSE): Unknown error. when I connect to a php page.

The conf files.


var.log_root    = "/var/log/lighttpd"
var.server_root = "/var/www"
var.state_dir   = "/var/run"
var.home_dir    = "/var/lib/lighttpd"
var.conf_dir    = "/etc/lighttpd"

var.vhosts_dir  = server_root + "/vhosts"

var.cache_dir   = "/var/cache/lighttpd"

var.socket_dir  = home_dir + "/sockets"

include "modules.conf"

server.port = 80

server.username  = "lighttpd"
server.groupname = "lighttpd"

server.pid-file = state_dir + "/lighttpd.pid"

server.errorlog = log_root + "/error.log"

include "conf.d/access_log.conf"

include "conf.d/debug.conf"

server.event-handler = "poll"

server.network-backend = "linux-sendfile"

server.max-fds = 2048

server.stat-cache-engine = "simple"

server.max-connections = 150

index-file.names += (
  "index.xhtml", "index.html", "index.htm", "default.htm", "index.php"

url.access-deny             = ( "~", ".inc" )

$HTTP["url"] =~ "\.pdf$" {
  server.range-requests = "disable"

static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" )

include "conf.d/mime.conf"

include "conf.d/dirlisting.conf"

server.follow-symlink = "enable"

server.upload-dirs = ( "/var/tmp" )


server.modules = (
  #"mod_fastcgi" #Not needed, referenced in /conf.d/fastcgi.conf
include "conf.d/fastcgi.conf"


server.modules += ( "mod_fastcgi" )

fastcgi.server = ( ".php" => (( 
                     "bin-path" => "/usr/bin/php-cgi",
                     "socket" => "/tmp/php-fastcgi.socket" 

Thanks, Max

  • If you run /usr/bin/php-cgi by hand, does it segfault? Also, is that the actual binary, or a script that sets up the environment variables for fastcgi then runs the actual binary? – DerfK Mar 13 '11 at 2:02
  • @DerfK How would I request it to process a php script? (lighttpd only seg faults on a php request). And the file looks like a binary (cat returned a lot of random info, and the file is 3 MB) – Ben Mar 13 '11 at 2:13
  • @mazzzzz /usr/bin/php-cgi /some/php/script.php you'll need to hit enter a couple of times since it will expect you to type in headers and stuff. – DerfK Mar 13 '11 at 13:28
  • It worked correctly, outputted some headers (powered by, content type), then ran the echo command correctly. Also, same error when root. – Ben Mar 13 '11 at 17:54
  • @mazzzzz OK, which distribution is this and did you get php and lighttpd and lighttpd's mod_fastcgi all from the same repository? – DerfK Mar 13 '11 at 18:41

Based on your comments, you have probably ended up mixing the mod_fastcgi.so from your custom install with the lighttpd version installed from the repository. Since the versions don't match, it crashes when you attempt to use it. Ideally, you'd uninstall the previous lighttpd attempt completely, but for now, run find / -name mod_fastcgi.so and remove everything it finds. Then, reinstall the lighttpd-fastcgi package to install the files that really should be there, with the correct version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.