简体   繁体   中英

Nginx failed after install php-pear and update memcache

Nginx was working fine before I ran these two commands:

  1. sudo apt-get install php-pear php5-dev
  2. sudo pecl install memcache-3.0.8

I wanted to update memcache to the latest version. Now I have a problem:

*21771 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "netcorner"

I killed php-fpm, but now when I try start it, I get:

ALERT: [pool www] user has not been defined
ERROR: failed to post process the configuration
ERROR: FPM initialization failed

EDIT: Problem is actual, restart helped first time, but when I second time restart server I can't run php-fpm.

You php-fpm pool configuration with the name www has no user entry. Usually a pool configuration looks somewhat similar to this one:

[php-fpm-1]
listen                       = /run/php-fpm-1.sock
catch_workers_output         = 1
chdir                        = /var/www
group                        = www-data
listen.backlog               = 32000
listen.group                 = www-data
listen.mode                  = 0600
listen.owner                 = www-data
pm                           = dynamic
pm.max_children              = 9
pm.max_spare_servers         = 4
pm.min_spare_servers         = 2
pm.start_servers             = 3
request_terminate_timeout    = 0
rlimit_core                  = unlimited
rlimit_files                 = 308506
security.limit_extensions    = .php
user                         = www-data

And it seems like that your pool configuration is missing the last directive. Might be that your update process of PHP altered your PHP configuration and now includes some pool definitions that weren't included before. Double check your php-fpm configuration and you should easily find the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM