php fcgi prozesse sterben weg

Apache, Lighttpd, nginx, Cherokee
braindead
RSAC
Posts: 257
Joined: 2002-10-22 09:49
Location: vorm Rechner

php fcgi prozesse sterben weg

Post by braindead » 2008-04-28 17:53

Hi,

ich hab ein Problem mit meinen PHP Prozessen. Leider sterben diese beim aufruf gewisser Seiten ohne sich mit einem Fehler zu verabschieden. Im Browser bekommt man die Halbe seite ausgegeben und die Ausgabe endet mitten im String. Es ist also keine Besondere Funktion oder sowas in der Art die da aufgerufen wird. Im Lighttpd error.log sieht das dann so aus:

Code: Select all

2008-04-28 16:47:15: (mod_fastcgi.c.3296) response already sent out, but backend returned error on socket: unix:/tmp/lighttpd_fphp.sock-1 for /groups/groups.list.php , terminating connection
2008-04-28 16:47:17: (mod_fastcgi.c.2471) unexpected end-of-file (perhaps the fastcgi process died): pid: 9382 socket: unix:/tmp/lighttpd_fphp.sock-1
2008-04-28 16:47:17: (mod_fastcgi.c.3296) response already sent out, but backend returned error on socket: unix:/tmp/lighttpd_fphp.sock-1 for /groups/groups.list.php , terminating connection
2008-04-28 16:48:04: (mod_fastcgi.c.2471) unexpected end-of-file (perhaps the fastcgi process died): pid: 9365 socket: unix:/tmp/lighttpd_fphp.sock-0
2008-04-28 16:48:04: (mod_fastcgi.c.3296) response already sent out, but backend returned error on socket: unix:/tmp/lighttpd_fphp.sock-0 for /groups/groups.list.php , terminating connection
2008-04-28 16:48:13: (mod_fastcgi.c.2471) unexpected end-of-file (perhaps the fastcgi process died): pid: 9365 socket: unix:/tmp/lighttpd_fphp.sock-0
2008-04-28 16:48:13: (mod_fastcgi.c.3296) response already sent out, but backend returned error on socket: unix:/tmp/lighttpd_fphp.sock-0 for /groups/groups.list.php , terminating connection
2008-04-28 16:48:13: (mod_fastcgi.c.2471) unexpected end-of-file (perhaps the fastcgi process died): pid: 9365 socket: unix:/tmp/lighttpd_fphp.sock-0
2008-04-28 16:48:13: (mod_fastcgi.c.3296) response already sent out, but backend returned error on socket: unix:/tmp/lighttpd_fphp.sock-0 for /groups/groups.list.php , terminating connection


Das ganze wird betrieben unter einem Debian und basiert auf einem Lighttpd 1.4.19 mit php 5.25.5, APC und memcached sind als Extensions geladen. Die phpinfo ist hier zu finden. Hier meine PHP Config:

Code: Select all

 [PHP]
    engine = On
    zend.ze1_compatibility_mode = Off
    short_open_tag = On
    asp_tags = Off
    precision = 14
    y2k_compliance = On
    output_buffering = On
    output_handler =
    zlib.output_compression = On
    zlib.output_compression_level = -1
    zlib.output_handler =
    implicit_flush = Off
    unserialize_callback_func =
    serialize_precision = 100
    allow_call_time_pass_reference = Off
    safe_mode = Off
    safe_mode_gid = Off
    safe_mode_include_dir =
    safe_mode_exec_dir =
    safe_mode_allowed_env_vars = PHP_
    safe_mode_protected_env_vars = LD_LIBRARY_PATH
    open_basedir =
    disable_functions = shell_exec, proc_open, proc_close, proc_get_status, proc_nice, proc_terminate, passthru, show_source, readfile
    disable_classes =
    highlight.string = #DD0000
    highlight.comment = #FF9900
    highlight.keyword = #007700
    highlight.bg = #FFFFFF
    highlight.default = #0000BB
    highlight.html = #000000
    ignore_user_abort = Off
    realpath_cache_size = 16k
    realpath_cache_ttl = 120
    expose_php = Off
    max_execution_time = 300
    max_input_time = 600
    memory_limit = 64M
    error_reporting = E_ALL ^ E_NOTICE ^ E_WARNING
    ;error_reporting = E_ALL
    ;error_log = "/var/log/lighttpd/phperr_log"
    display_errors = On
    display_startup_errors = Off
    log_errors = Off
    log_errors_max_len = 1024
    ignore_repeated_errors = Off
    ignore_repeated_source = Off
    report_memleaks = On
    report_zend_debug = 0
    track_errors = Off
    html_errors = Off
    arg_separator.output = "&"
    arg_separator.input = ";&"
    variables_order = "GPCS"
    register_globals = Off
    register_long_arrays = Off
    register_argc_argv = Off
    auto_globals_jit = On
    post_max_size = 8M
    magic_quotes_gpc = Off
    magic_quotes_runtime = Off
    magic_quotes_sybase = Off
    auto_prepend_file =
    auto_append_file =
    default_mimetype = "text/html"
    ;default_charset = "iso-8859-1"
    always_populate_raw_post_data = Off
    ;include_path = ".:/usr/share/php5:/usr/share/php"
    doc_root =
    user_dir =
    enable_dl = On
    ;fastcgi.log = 0
    ;cgi.rfc2616_headers = 0
    file_uploads = On
    upload_tmp_dir =
    upload_max_filesize = 8M
    cgi.fix_pathinfo = 1
    allow_url_fopen = On
    allow_url_include = Off
    from = "john@doe.com"
    user_agent = ""
    default_socket_timeout = 60
    auto_detect_line_endings = Off
    extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613/"
    extension=apc.so
    extension=memcache.so

    [Date]
    ;date.timezone =
    ;date.default_latitude = 31.7667
    ;date.default_longitude = 35.2333
    ;date.sunrise_zenith = 90.583333
    ;date.sunset_zenith = 90.583333

    [filter]
    ;filter.default = unsafe_raw
    ;filter.default_flags =

    [iconv]
    ;iconv.input_encoding = ISO-8859-1
    ;iconv.internal_encoding = ISO-8859-1
    ;iconv.output_encoding = ISO-8859-1

    [sqlite]
    ;sqlite.assoc_case = 0

    [xmlrpc]
    ;xmlrpc_error_number = 0
    ;xmlrpc_errors = 0

    [Pcre]
    ;pcre.recursion_limit = 100000
    ;pcre.backtrack_limit = 100000

    [Syslog]
    define_syslog_variables = Off

    [mail function]
    SMTP = localhost
    smtp_port = 25
    ;sendmail_path = "/usr/sbin/sendmail -t -i"
    ;mail.force_extra_parameters =

    [SQL]
    sql.safe_mode = Off

    [MySQL]
    mysql.allow_persistent = Off
    mysql.max_persistent = -1
    mysql.max_links = -1
    mysql.default_port =
    mysql.default_socket =
    mysql.default_host =
    mysql.default_user =
    mysql.default_password =
    mysql.connect_timeout = 60
    mysql.trace_mode = Off

    [MySQLi]
    mysqli.max_links = -1
    mysqli.default_port = 3306
    mysqli.default_socket =
    mysqli.default_host =
    mysqli.default_user =
    mysqli.default_pw =
    mysqli.reconnect = Off

    [PostgresSQL]
    pgsql.allow_persistent = Off
    pgsql.auto_reset_persistent = Off
    pgsql.max_persistent = -1
    pgsql.max_links = -1
    pgsql.ignore_notice = 0
    pgsql.log_notice = 0

    [bcmath]
    bcmath.scale = 0

    [browscap]
    ;browscap = "extra/browscap.ini"

    [Session]
    session.save_handler = files
    session.save_path = "/dev/shm"
    session.use_cookies = 1
    session.cookie_secure =
    session.use_only_cookies = 0
    session.name = PHPSESSID
    session.auto_start = 0
    session.cookie_lifetime = 0
    session.cookie_path = "/"
    session.cookie_domain =
    session.cookie_httponly =
    session.serialize_handler = php
    session.gc_probability = 1
    session.gc_divisor = 1000
    session.gc_maxlifetime = 1440
    session.bug_compat_42 = 0
    session.bug_compat_warn = 1
    session.referer_check =
    session.entropy_length = 16
    session.entropy_file = "/dev/urandom"
    session.cache_limiter = nocache
    session.cache_expire = 180
    session.use_trans_sid = 0
    session.hash_function = 1
    session.hash_bits_per_character = 6
    url_rewriter.tags = "a=href,area=href,frame=src,input=src,fieldset="

    [Assertion]
    assert.active = On
    assert.warning = On
    assert.bail = Off
    assert.callback = 0
    assert.quiet_eval = 0

    [mbstring]
    ;mbstring.language = Japanese
    ;mbstring.internal_encoding = EUC-JP
    ;mbstring.http_input = auto
    ;mbstring.http_output = SJIS
    ;mbstring.encoding_translation = Off
    ;mbstring.detect_order = auto
    ;mbstring.substitute_character = none;
    ;mbstring.func_overload = 0
    ;mbstring.strict_encoding = Off

    [gd]
    gd.jpeg_ignore_warning = 0

    [exif]
    ;exif.encode_unicode = ISO-8859-15
    ;exif.decode_unicode_motorola = UCS-2BE
    ;exif.decode_unicode_intel = UCS-2LE
    ;exif.encode_jis =
    ;exif.decode_jis_motorola = JIS
    ;exif.decode_jis_intel = JIS

    [Tidy]
    tidy.clean_output = Off

    [soap]
    soap.wsdl_cache_enabled = 1
    soap.wsdl_cache_dir = "/tmp"
    soap.wsdl_cache_ttl = 86400

    [apc]
    apc.enabled=1
    apc.shm_segments=1
    apc.optimization=0
    apc.shm_size=128
    apc.ttl=7200
    apc.user_ttl=7200
    apc.num_files_hint=1024
    apc.mmap_file_mask=/dev/shm/apc.XXXXXX
    apc.enable_cli=1


und die Lighttpd config:

Code: Select all

server.modules              = ( "mod_accesslog",
                                "mod_compress",
                                "mod_access",
                                "mod_fastcgi",
                                "mod_redirect",
                                "mod_status",
                                "mod_auth" )

server.document-root        = "/var/www/doolao/htdocs"
server.errorlog             = "/var/log/lighttpd/error.log"
accesslog.filename          = "/var/log/lighttpd/access.log"
server.max-fds = 2048
server.pid-file             = "/var/run/lighttpd.pid"
server.max-keep-alive-requests  = 4
server.max-keep-alive-idle      = 4
server.error-handler-404 = "/404.php"
index-file.names            = ( "index.html", "index.php",
                             "index.htm", "default.htm" )

mimetype.assign             = (
  ".pdf"          =>      "application/pdf",
  ".sig"          =>      "application/pgp-signature",
  ".spl"          =>      "application/futuresplash",
  ".class"        =>      "application/octet-stream",
  ".ps"           =>      "application/postscript",
  ".torrent"      =>      "application/x-bittorrent",
  ".dvi"          =>      "application/x-dvi",
  ".gz"           =>      "application/x-gzip",
  ".pac"          =>      "application/x-ns-proxy-autoconfig",
  ".swf"          =>      "application/x-shockwave-flash",
  ".tar.gz"       =>      "application/x-tgz",
  ".tgz"          =>      "application/x-tgz",
  ".tar"          =>      "application/x-tar",
  ".zip"          =>      "application/zip",
  ".mp3"          =>      "audio/mpeg",
  ".m3u"          =>      "audio/x-mpegurl",
  ".wma"          =>      "audio/x-ms-wma",
  ".wax"          =>      "audio/x-ms-wax",
  ".ogg"          =>      "application/ogg",
  ".wav"          =>      "audio/x-wav",
  ".gif"          =>      "image/gif",
  ".jpg"          =>      "image/jpeg",
  ".jpeg"         =>      "image/jpeg",
  ".png"          =>      "image/png",
  ".xbm"          =>      "image/x-xbitmap",
  ".xpm"          =>      "image/x-xpixmap",
  ".xwd"          =>      "image/x-xwindowdump",
  ".css"          =>      "text/css",
  ".html"         =>      "text/html",
  ".htm"          =>      "text/html",
  ".js"           =>      "text/javascript",
  ".asc"          =>      "text/plain",
  ".c"            =>      "text/plain",
  ".cpp"          =>      "text/plain",
  ".log"          =>      "text/plain",
  ".conf"         =>      "text/plain",
  ".text"         =>      "text/plain",
  ".txt"          =>      "text/plain",
  ".dtd"          =>      "text/xml",
  ".xml"          =>      "text/xml",
  ".mpeg"         =>      "video/mpeg",
  ".mpg"          =>      "video/mpeg",
  ".mov"          =>      "video/quicktime",
  ".qt"           =>      "video/quicktime",
  ".avi"          =>      "video/x-msvideo",
  ".asf"          =>      "video/x-ms-asf",
  ".asx"          =>      "video/x-ms-asf",
  ".wmv"          =>      "video/x-ms-wmv",
  ".bz2"          =>      "application/x-bzip",
  ".tbz"          =>      "application/x-bzip-compressed-tar",
  ".tar.bz2"      =>      "application/x-bzip-compressed-tar"
 )

url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
server.chroot              = "/"
server.username            = "www-data"
server.groupname           = "www-data"
compress.cache-dir         = "/dev/shm/lighttpd"
compress.filetype          = ("text/plain", "text/html", "text/css", "text/javascript")

#fastcgi.server = ( ".php" =>
#  (( "host" => "127.0.0.1",    "port" => 1030 ))
#)

status.status-url          = "/server-status"
status.config-url          = "/server-config"

fastcgi.server = (
    ".php" => ((
        "bin-path" => "/usr/local/bin/php-cgi",
        "socket" => "/tmp/lighttpd_fphp.sock",
        "min-procs" => 2,
        "max-procs" => 2,
        "bin-environment" => (
            "PHP_FCGI_CHILDREN" => "16",
            "PHP_FCGI_MAX_REQUESTS" => "1000"
        ),
        "bin-copy-environment" => (
            "PATH",
            "SHELL",
            "USER"
        ),
        "broken-scriptfilename" => "enable"
    ))
)


Hab das ganze vorher schonmal versucht mit extern gespawnten FCGIs, das hat aber genauso wenig geklappt.

jan10001
Anbieter
Posts: 727
Joined: 2004-01-02 12:17

Re: php fcgi prozesse sterben weg

Post by jan10001 » 2008-04-29 08:45

Leider sterben diese beim aufruf gewisser Seiten ohne sich mit einem Fehler zu verabschieden.
Was dafür spricht das irgendetwas an diesen Seiten anders ist. :wink: Also Unterschied finden dann kennst du dein Problem.

braindead
RSAC
Posts: 257
Joined: 2002-10-22 09:49
Location: vorm Rechner

Re: php fcgi prozesse sterben weg

Post by braindead » 2008-04-30 11:04

Ok, ein Problem hab ich jetzt gefunden. Anscheinend haben wir einen Bug im APC gefunden. Ich hab jetzt mittlerweile den APC deaktiviert. Jetzt treten die Probleme zwar weit weniger oft auf, aber jetzt bei allen Seiten (das war vorher auch schon so nur da ist es durch die Masse der APC Fehler nicht so aufgefallen). Ich hab so das Gefühl das PHP 5.2.5 irgendwie Probleme mit allen Erweiterungen hat (APC und Memcached auf jeden Fall)...

braindead
RSAC
Posts: 257
Joined: 2002-10-22 09:49
Location: vorm Rechner

Re: php fcgi prozesse sterben weg

Post by braindead » 2008-05-05 22:23

Yeha, PHP 5.2.6 hat alle meine Probleme gelöst so wie es aussieht.