Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

lighttpd.conf

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" )

modules.conf

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

conf.d/fastcgi.conf

server.modules += ( "mod_fastcgi" )

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

Thanks, Max

share|improve this question
    
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) –  mazzzzz 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. –  mazzzzz 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
show 1 more comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
    
You're brilliant, thanks for the save. –  mazzzzz Mar 14 '11 at 23:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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