Ubuntu php5-fpm throws unknown instance on reload

前端 未结 9 823
忘了有多久
忘了有多久 2020-12-24 06:28

I am having some problems with ubuntu and php5-fpm on my VPS. Php works fine, however it throws terminal error when I am trying to reload / restart / stop it. Basically, I c

相关标签:
9条回答
  • 2020-12-24 07:13

    For me it turned out to be an error in pool configuration file (loaded from pool.d directory)

    Try running php-fpm7.0 -t to run configtest (name of the executable may vary based on your installation and name of the service)

    0 讨论(0)
  • 2020-12-24 07:18

    This is a Ubuntu bug. In /etc/init/php5-fpm.conf, there is a commented-out line reload signal USR2, which causes the reload function to terminate the php5-fpm master process by sending SIGHUP. Any further reloads, restarts or stops will fail, because the master process has been terminated.

    I fixed this in Ubuntu 14.04 by creating a file /etc/init/php5-fpm.override with the single line reload signal USR2 in it. Credits to Jurian Sluiman's comment in this answer.

    Here is the primary bug report, proposed workarounds, and confirmation of workaround.

    $ ps aux | grep php
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root      1966  0.0  0.9 473276 37040 ?        Ss   10:03   0:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)                    
    www-data  2009  0.0  1.5 478280 62500 ?        S    10:03   0:01 php-fpm: pool www                                                       
    www-data  2011  0.0  1.3 476504 55220 ?        S    10:03   0:00 php-fpm: pool www                                                       
    www-data  2012  0.0  1.6 481592 65840 ?        S    10:03   0:00 php-fpm: pool www
    
    $ sudo service php5-fpm status
    php5-fpm start/running, process 1966
    
    $ sudo service php5-fpm stop
    php5-fpm stop/waiting
    
    $ sudo service php5-fpm status
    php5-fpm stop/waiting
    
    $ sudo service php5-fpm start
    php5-fpm start/running, process 2651
    
    $ sudo service php5-fpm status
    php5-fpm start/running, process 2651
    
    $ ps aux | grep php
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root      2651  0.2  0.9 473276 36996 ?        Ss   10:35   0:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)                    
    www-data  2654  0.0  0.1 473276  7104 ?        S    10:35   0:00 php-fpm: pool www                                                       
    www-data  2655  0.0  0.1 473276  7104 ?        S    10:35   0:00 php-fpm: pool www                                                       
    www-data  2656  0.0  0.1 473276  7104 ?        S    10:35   0:00 php-fpm: pool www
    
    0 讨论(0)
  • 2020-12-24 07:19

    When none of the above answers solves the problem, test your configuration to see your mistakes:

    $ php5-fpm -t
    

    I most cases you probably made a mistake in your /etc/php5/fpm/php-fpm.conf or /etc/php5/fpm/pool.d/www.conf

    0 讨论(0)
提交回复
热议问题