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.

I'm having a very difficult case with latest php5-fpm (from debphp) and nginx 1.4.3 on Ubtuntu 12.04LTS.

In short, I cannot start php5-fp at all, I keep getting this error in syslog:

kernel: [1213013.564441] init: php5-fpm main process (7357) terminated with status 78

kernel: [1213013.564496] init: php5-fpm main process ended, respawning

..... (repeated several times)

kernel: [1213014.143911] init: php5-fpm respawning too fast, stopped

My /var/log/php5-fpm.log is not populated at all. There is no php5-fpm.sock and php5-fpm.pid in /run (or /var/run).

My /etc/php5/fpm/php-fpm.conf is below: (this file doesnt seem to be loaded now as I tried to put some bogus info into it but didn't cause any change)

;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;

include=/etc/php5/fpm/*.conf

;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;

[global]
; Pid file
; Note: the default prefix is /var
; Default Value: none
pid = /run/php5-fpm.pid
catch_workers_output = yes


; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
log_level = debug

; To configure the pools it is recommended to have one .conf file per
; pool in the following directory:
include=/etc/php5/fpm/pool.d/*.conf
include=/var/www/vhosts/mysite.com/w/w/w/www/config/fpm-pool.conf

Permission checking:

ls -l /etc/php5/fpm/php-fpm.conf

-rwxrwxrwx 1 root root 4641 Nov  6 01:37 /etc/php5/fpm/php-fpm.conf

My include=/var/www/vhosts/mysite.com/w/w/w/www/config/fpm-pool.conf (this file does not seem to be loaded anymore)

[www.mysite.com]
    listen                 = /run/php5-fpm.sock
#    listen                = 127.0.0.1:9000
    listen.backlog         = -1
    listen.allowed_clients = 127.0.0.1
    listen.owner           = www.mysite.com
    listen.group           = mysite.com
    listen.mode            = 0666

    user  = www.mysite.com
    group = mysite.com

    pm                   = dynamic
    pm.max_requests      = 0
    pm.max_children      = 15
    pm.start_servers     = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3

    pm.status_path       = /php_pool_wwww.mysite.com_status
    ping.path            = /www.mysite.com_ping
    ping.response        = www.mysite.com_pong

    request_terminate_timeout = 30
    request_slowlog_timeout   = 20
    slowlog                   = /var/www/vhosts/mysite.com/w/w/w/www/logs/php-slow.log

    rlimit_files = 131072
    rlimit_core = unlimited

     chroot = /var/www/vhosts/mysite.com/w/w/w/www/
    ; Chdir to this directory at the start. This value must be an absolute path.
    ; Default Value: current directory or / when chroot
    ; chdir = /htdocs

    catch_workers_output = yes

    env[HOSTNAME] = $HOSTNAME
    env[TMP]      = /tmp
    env[TMPDIR]   = /tmp
    env[TEMP]     = /tmp

    security.limit_extension = .php
    ;   php_value/php_flag             - you can set classic ini defines which can
    ;                                    be overwritten from PHP call 'ini_set'.
    ;   php_admin_value/php_admin_flag - these directives won't be overwritten by
    ;                                     PHP call 'ini_set'
    php_flag[display_errors]            = on
    php_admin_value[error_log]          = /logs/php_err.log
    php_admin_flag[log_errors]          = on
    php_admin_value[memory_limit]       = 100M
    php_value[max_execution_time]       = 300

Permission checking:

ls -l /var/www/vhosts/mysite.com/w/w/w/www/config/fpm-pool.conf

-rwxr-xr-x 1 www.mysite.com mysite.com 1830 Nov  6 01:05 var/www/vhosts/mysite.com/w/w/w/www/config/fpm-pool.conf

User/Group Permission checking:

groups www.mysite.com

www.mysite.com : www.mysite.com www-data mysite.com

I don't think this has anything to do with nginx because php5-fpm itself cannot start at all right now anyhow, but for the sake of having all info: nginx is also set to use same user/group

share
add comment

1 Answer

The process that upstart was watching died, but the pool workers are still running. To fix it, run:

sudo killall php-fpm
sudo start php5-fpm

The php5-fpm job will repeatedly exit with status 78 until all of the old worker threads are dead. Note that the server is typically functional in this state, even though upstart isn't managing the service. When it eventually dies, though, it won't automatically respawn, so it should be fixed ASAP. A simple reboot will also fix the problem, but will result in downtime.

share
add comment

This site is currently not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .