Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Lighttpd and php-cli ends in segfaulting
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dronin
n00b
n00b


Joined: 10 Mar 2004
Posts: 48
Location: Feucht/Germany

PostPosted: Sat Sep 19, 2009 5:40 pm    Post subject: Lighttpd and php-cli ends in segfaulting Reply with quote

Hi there,

I have a problem with my lighttpd and php-cli (5.2.10-r1).
Every time I try to start lighty it crashes with following error output in the logfiles:

Code:
2009-09-18 19:34:57: (log.c.172) server started
2009-09-18 19:34:57: (mod_fastcgi.c.1087) the fastcgi-backend /usr/bin/php-cgi failed to start:
2009-09-18 19:34:57: (mod_fastcgi.c.1098) terminated by signal: 11
2009-09-18 19:34:57: (mod_fastcgi.c.1103) to be exact: it segfaulted, crashed, died, ... you get the idea.
2009-09-18 19:34:57: (mod_fastcgi.c.1105) If this is PHP, try removing the bytecode caches for now and try again.
2009-09-18 19:34:57: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed.
2009-09-18 19:34:57: (server.c.928) Configuration of plugins failed. Going down.


and dmesg tells me:

Code:
grsec: From 212.123.98.153: exec of /usr/lib64/php5/bin/php-cgi (/usr/bin/php-cgi ) by /usr/sbin/lighttpd[lighttpd:29926] uid/euid:103/103 gid/egid:5005/5005, parent /usr/sbin/lighttpd[lighttpd:29923] uid/euid:103/103 gid/egid:5005/5005
grsec: From 212.123.98.153: exec of /sbin/killall5 (/bin/pidof -x /usr/sbin/lighttpd ) by /sbin/runscript.sh[runscript.sh:29927] uid/euid:0/0 gid/egid:0/0, parent /sbin/runscript.sh[runscript.sh:29924] uid/euid:0/0 gid/egid:0/0
grsec: From 212.123.98.153: exec of /usr/bin/rrdtool (/usr/bin/rrdtool - ) by /usr/sbin/lighttpd[lighttpd:29925] uid/euid:103/103 gid/egid:5005/5005, parent /usr/sbin/lighttpd[lighttpd:29923] uid/euid:103/103 gid/egid:5005/5005
grsec: From 212.123.98.153: exec of /bin/sleep (/bin/sleep 0.1 ) by /sbin/runscript.sh[runscript.sh:29928] uid/euid:0/0 gid/egid:0/0, parent /sbin/runscript.sh[runscript.sh:29915] uid/euid:0/0 gid/egid:0/0
php-cgi[29926]: segfault at 71 ip 00000000007200dc sp 00007667c61ff6b0 error 4 in php-cgi[400000+689000]
grsec: From 212.123.98.153: signal 11 sent to /usr/lib64/php5/bin/php-cgi[php-cgi:29926] uid/euid:103/103 gid/egid:5005/5005, parent /usr/sbin/lighttpd[lighttpd:29923] uid/euid:103/103 gid/egid:5005/5005



attached my lighty config:

Code:
cat 04_fussel_vhost.conf

$HTTP["host"] =~ "^fussel.ch" {
        url.redirect = ( "^/(.*)" => "https://www.fussel.ch/$1" )
}
        url.rewrite-once = (
        "^/wiki/[sS]kins.*$"  =>      "$0",
        "^/wiki/([^\?]*)$"    =>      "/wiki/index.php?title=$1",
        )       

$HTTP["host"] == "www.fussel.ch" {
        var.localroot = var.vhostbase + "/fussel.ch"
        server.document-root = var.localroot + "/htdocs"

        var.localuid = "5007"
        var.localgid = "5007"
        var.localwrapper = "php-fussel"

        include "modules/mod_fastcgi.conf"


        accesslog.filename = var.localroot + "/var/log/access.log"
}

$SERVER["socket"] == "80.xxx.xxx.xxx:443" {
        var.localroot = var.vhostbase + "/fussel.ch"

        var.localuid = "5007"
        var.localgid = "5007"
        var.localwrapper = "php-fussel"

        include "modules/mod_fastcgi.conf"


        ssl.engine                  = "enable"
        ssl.pemfile                 = "/etc/lighttpd/ssl/fussel.ch/fussel.ch.pem"
        ssl.ca-file                 = "/etc/lighttpd/ssl/digital-bit.ch/startssl.ca.crt"
        server.name                 = "www.fussel.ch"

        server.document-root = var.localroot + "/htdocs"


I don't know how to debug this deeper.
Apache with mpm-peruser and mod_php works fine, but I want to go back to lighty and not workaround here.

Hope somebody can help, thanks in advance
Back to top
View user's profile Send private message
mimosinnet
l33t
l33t


Joined: 10 Aug 2006
Posts: 717
Location: Barcelona, Spain

PostPosted: Mon Jan 24, 2011 4:04 am    Post subject: Re: Lighttpd and php-cli ends in segfaulting Reply with quote

I just had the same problem. In my case, the issue was with the configuration of extension_dir in /etc/php/cgi-php5.3/php.ini. Now I have:

Code:
# php-cgi -i | grep extension_dir
<tr><td class="e">extension_dir</td><td class="v">[b]/usr/lib64/php5.3/lib/extensions/no-debug-zts-20090626[/b]</td><td class="v">/usr/lib64/php5.3/lib/extensions/no-debug-zts-20090626</td></tr>


Cheers!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum