Apache2 + PHP5-CGI + mod_suphp = Segmentation Fault

Apache, Lighttpd, nginx, Cherokee
Post Reply
blaue0
Posts: 22
Joined: 2004-06-25 00:37
Contact:
 

Apache2 + PHP5-CGI + mod_suphp = Segmentation Fault

Post by blaue0 »

Ich habe Apache2, PHP5, mod_suphp wie folgt auf Gentoo installiert:

Code: Select all

[ebuild   R   ] net-www/apache-2.0.54-r14  +apache2 -debug -doc -ldap -mpm-leader -mpm-peruser +mpm-prefork -mpm-threadpool -mpm-worker -no-suexec (-selinux) +ssl -static-modules -threads 0 kB
[ebuild   R   ] dev-lang/php-5.0.4  -adabas -apache +apache2 -bcmath -berkdb -birdstep +bzip2 -calendar -cdb +cgi +cli +crypt -ctype +curl -curlwrappers -db2 -dba -dbase -dbm -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob +exif -fdftk -filepro -firebird -flatfile -force-cgi-redirect -frontbase +ftp +gd -gd-external -gdbm -gmp -hardenedphp -hyperwave-api -iconv +imap -informix -inifile -interbase -iodbc -ipv6 -java-external +jpeg -kerberos -ldap -libedit -mcve -memlimit -mhash -ming -msql -mssql +mysql +mysqli +ncurses +nls -oci8 -odbc -oracle7 -ovrimos -pcntl +pcre -pdo-external -pear -pfpro +png -posix -postgres -qdbm +readline -recode -sapdb -sasl +session -sharedext -sharedmem +simplexml -snmp +soap +sockets -solid +spell +spl -sqlite +ssl -sybase -sybase-ct -sysvipc -threads -tidy -tiff -tokenizer +truetype -wddx +xml2 -xmlrpc -xpm +xsl -yaz -zip +zlib 0 kB
[ebuild   R   ] www-apache/mod_suphp-0.6.0  -checkpath -mode-force -mode-owner +mode-paranoid 0 kB
Danach habe ich in /etc/conf.d/apache -D SUPHP eingefügt, was folgendes Configfile hinzufügt:

Code: Select all

<IfDefine SUPHP>
        <IfModule !mod_suphp.c>
                LoadModule suphp_module modules/mod_suphp.so
        </IfModule>

        <IfModule mod_mime.c>
                AddType application/x-httpd-php   .php
                AddType application/x-suphp-cgi   .cgi .pl
        </IfModule>

        AddHandler x-httpd-php   .php
        AddHandler x-suphp-cgi   .cgi .pl

        suPHP_Engine on

        <Location />
                SuPHP_AddHandler x-httpd-php
                SuPHP_AddHandler x-suphp-cgi
        </Location>

        # if you're using owner mode comment the following line
        SuPHP_UserGroup apache apache

        AddDirectoryIndex index.php index.php5 index.php4 index.php3 index.phtml
</IfDefine>
Versuche ich nun eine PHP Seite anzuzeigen, geschieht folgendes:

Code: Select all

[Thu Sep 08 13:51:08 2005] [notice] child pid 24731 exit signal Segmentation fault (11)
die /etc/suphp.conf schaut so aus:

Code: Select all

[global]
;Path to logfile
logfile=/var/log/apache2/suphp_log

;Loglevel
loglevel=info

;User Apache is running as
webserver_user=apache

;Path all scripts have to be in
docroot=/

; Security options
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false

;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=false

;Send minor error messages to browser
errors_to_browser=true

;PATH environment variable
env_path=/bin:/usr/bin

;Umask to set, specify in octal notation
umask=0077

; Minimum UID
min_uid=81

; Minimum GID
min_gid=81

[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php-cgi

;Handler for CGI-scripts
x-suphp-cgi=execute:!self
php-cgi -v sagt folgendes:

Code: Select all

PHP 5.0.4 (cgi-fcgi) (built: Sep  8 2005 08:57:54)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies
Was läuft da falsch?!
Roger Wilco
Posts: 5923
Joined: 2004-05-23 12:53
 

Re: Apache2 + PHP5-CGI + mod_suphp = Segmentation Fault

Post by Roger Wilco »

Lädst du auch mod_php? Mit dem USE-Flag apache2 wird dieses nämlich zumindest mal installiert.
blaue0
Posts: 22
Joined: 2004-06-25 00:37
Contact:
 

Re: Apache2 + PHP5-CGI + mod_suphp = Segmentation Fault

Post by blaue0 »

Nein mod_php ist nicht geladen. Installiert hab ich es nur, weil ich es aus Aushilfslösung benötige.
Roger Wilco
Posts: 5923
Joined: 2004-05-23 12:53
 

Re: Apache2 + PHP5-CGI + mod_suphp = Segmentation Fault

Post by Roger Wilco »

Was für eine MPM setzt du im Apache ein?
blaue0
Posts: 22
Joined: 2004-06-25 00:37
Contact:
 

Re: Apache2 + PHP5-CGI + mod_suphp = Segmentation Fault

Post by blaue0 »

Code: Select all

[ebuild   R   ] net-www/apache-2.0.54-r14  +apache2 -debug -doc -ldap -mpm-leader -mpm-peruser +mpm-prefork -mpm-threadpool -mpm-worker -no-suexec (-selinux) +ssl -static-modules -threads 0 kB 
Den mpm-prefork
Roger Wilco
Posts: 5923
Joined: 2004-05-23 12:53
 

Re: Apache2 + PHP5-CGI + mod_suphp = Segmentation Fault

Post by Roger Wilco »

Hm, seltsam. Der Apache schmiert nur ab, wenn er ein PHP-Skript parsen soll?
Wenn du die Auswertung nicht scheust, versuche mal strace auf den Apache-Prozess loszulassen. Ansonsten gehen mir langsam die Ideen aus.
blaue0
Posts: 22
Joined: 2004-06-25 00:37
Contact:
 

Re: Apache2 + PHP5-CGI + mod_suphp = Segmentation Fault

Post by blaue0 »

Hab ich:

Code: Select all

kladde ~ # strace -fp 24056
Process 24056 attached - interrupt to quit
select(0, NULL, NULL, NULL, {0, 380000}) = 0 (Timeout)
waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
select(0, NULL, NULL, NULL, {1, 0})     = ? ERESTARTNOHAND (To be restarted)
--- SIGCHLD (Child exited) @ 0 (0) ---
select(0, NULL, NULL, NULL, {0, 176000}) = 0 (Timeout)
fork(Process 24119 attached
)                                  = 24119
[pid 24056] waitpid(-1, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV}],
WNOHANG|WSTOPPED) = 24108
[pid 24119] getpid( <unfinished ...>
[pid 24056] gettimeofday( <unfinished ...>
[pid 24119] <... getpid resumed> )      = 24119
[pid 24056] <... gettimeofday resumed> {1126074919, 528166}, NULL) = 0
[pid 24119] rt_sigaction(SIGHUP, {0xb7d7cf00, [], SA_INTERRUPT},  <unfinished ...>
[pid 24056] write(6, "[Wed Sep 07 08:35:19 2005] [noti"..., 88 <unfinished ...>
[pid 24119] <... rt_sigaction resumed> {0xb7d7cf00, [HUP USR1], 0}, 8) = 0
[pid 24056] <... write resumed> )       = 88
[pid 24119] rt_sigaction(SIGTERM, {0xb7d7cf00, [], SA_INTERRUPT},  <unfinished ...>
[pid 24056] waitpid(-1,  <unfinished ...>
[pid 24119] <... rt_sigaction resumed> {0xb7d7cf00, [], 0}, 8) = 0
[pid 24056] <... waitpid resumed> 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
[pid 24119] rt_sigaction(SIGUSR1, {SIG_IGN},  <unfinished ...>
[pid 24056] select(0, NULL, NULL, NULL, {1, 0} <unfinished ...>
[pid 24119] <... rt_sigaction resumed> {0xb7d7cf00, [HUP USR1], 0}, 8) = 0
[pid 24119] getpid()                    = 24119
[pid 24119] getpid()                    = 24119
[pid 24119] brk(0x8188000)              = 0x8188000
[pid 24119] geteuid32()                 = 0
[pid 24119] setgid32(81)                = 0
[pid 24119] open("/proc/sys/kernel/ngroups_max", O_RDONLY) = 8
[pid 24119] read(8, "65536n", 31)      = 6
[pid 24119] close(8)                    = 0
[pid 24119] open("/etc/group", O_RDONLY) = 8
[pid 24119] fcntl64(8, F_GETFD)         = 0
[pid 24119] fcntl64(8, F_SETFD, FD_CLOEXEC) = 0
[pid 24119] _llseek(8, 0, [0], SEEK_CUR) = 0
[pid 24119] fstat64(8, {st_mode=S_IFREG|0644, st_size=1045, ...}) = 0
[pid 24119] mmap2(NULL, 1045, PROT_READ, MAP_SHARED, 8, 0) = 0xb7bdb000
[pid 24119] _llseek(8, 1045, [1045], SEEK_SET) = 0
[pid 24119] fstat64(8, {st_mode=S_IFREG|0644, st_size=1045, ...}) = 0
[pid 24119] munmap(0xb7bdb000, 1045)    = 0
[pid 24119] close(8)                    = 0
[pid 24119] setgroups32(1, [81])        = 0
[pid 24119] geteuid32()                 = 0
[pid 24119] setuid32(81)                = 0
[pid 24119] getpid()                    = 24119
[pid 24119] accept(3,  <unfinished ...>
[pid 24056] <... select resumed> )      = 0 (Timeout)
[pid 24056] waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
[pid 24056] select(0, NULL, NULL, NULL, {1, 0} <unfinished ...>
Process 24056 detached
Process 24119 detached
Da werd ich aber nicht so wirklich schlau draus...
Post Reply