V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kmdd33
V2EX  ›  程序员

在线等: PHP -fpm 无法启动(Failed to start The PHP FastCGI Process Manager.)

  •  
  •   kmdd33 · 2018-06-09 02:16:03 +08:00 · 15998 次点击
    这是一个创建于 2367 天前的主题,其中的信息可能已经有所发展或是发生改变。

    执行:sudo systemctl start php-fpm 后

    Job for php-fpm.service failed because the control process exited with error code. See "systemctl status php-fpm.service" and "journalctl -xe" for details.

    按照提示输入 systemctl status php-fpm.service

    错误代码:

    systemctl status php-fpm.service

    ● php-fpm.service - The PHP FastCGI Process Manager

    Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)

    Active: failed (Result: exit-code) since Fri 2018-06-08 17:57:03 UTC; 8s ago

    Process: 1978 ExecStart=/usr/sbin/php-fpm --nodaemonize --fpm-config /etc/php-fpm.conf (code=exited, status=78)

    Main PID: 1978 (code=exited, status=78)

    Jun 08 17:57:03 servername systemd[1]: Starting The PHP FastCGI Process Manager...

    Jun 08 17:57:03 servername php-fpm[1978]: [08-Jun-2018 17:57:03] ERROR: [pool www] cannot get...nx'

    Jun 08 17:57:03 servername php-fpm[1978]: [08-Jun-2018 17:57:03] ERROR: FPM initialization failed

    Jun 08 17:57:03 servername systemd[1]: php-fpm.service: main process exited, code=exited, sta...n/a

    Jun 08 17:57:03 servername systemd[1]: Failed to start The PHP FastCGI Process Manager.

    Jun 08 17:57:03 servername systemd[1]: Unit php-fpm.service entered failed state.

    Jun 08 17:57:03 servername systemd[1]: php-fpm.service failed.

    Hint: Some lines were ellipsized, use -l to show in full.

    怎么办?请教同学们.

    环境:openresty php7 mysql centos7

    yum install php71w-fpm

    Package php71w-fpm-7.1.17-1.w7.x86_64 already installed and latest version Nothing to do

    error.log 的错误提示:

    2018/06/08 18:14:23 [error] 825#825: *47 connect() failed (111: Connection refused) while connecting to upstream

    14 条回复    2018-06-09 16:59:45 +08:00
    kmdd33
        1
    kmdd33  
    OP
       2018-06-09 02:21:56 +08:00
    netstat -ant | grep 9000 没有任何提示
    Nitroethane
        2
    Nitroethane  
       2018-06-09 08:58:29 +08:00 via Android
    查看 status 的时候就不能加个 -l 参数吗?难道你没发现最关键的一行报错信息被省略了?
    JHerschel
        3
    JHerschel  
       2018-06-09 09:05:28 +08:00
    怕是配置文件改炸了哦。
    zqcolor
        4
    zqcolor  
       2018-06-09 12:19:46 +08:00
    这句的完整内容是啥,是否和 nginx 有关

    Jun 08 17:57:03 servername php-fpm[1978]: [08-Jun-2018 17:57:03] ERROR: [pool www] cannot get...nx'
    lolizeppelin
        5
    lolizeppelin  
       2018-06-09 12:48:33 +08:00 via Android
    这都解决不了不要瞎编译 老老实实用 RPM
    kmdd33
        6
    kmdd33  
    OP
       2018-06-09 15:53:05 +08:00
    @lolizeppelin php7 和 php-fpm 都是 yum 安装的
    kmdd33
        7
    kmdd33  
    OP
       2018-06-09 15:56:49 +08:00
    @zqcolor

    这是完整的 error.log 信息:

    2018/06/08 18:14:11 [error] 825#825: *31 connect() failed (111: Connection refused) while connecting to upstream,
    client: 103.242.0.73, server: 173.255.247.37, request: "GET /pma/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "xxx.xxx.xxx.xx"
    kmdd33
        8
    kmdd33  
    OP
       2018-06-09 16:01:53 +08:00
    @Nitroethane 重新输入 systemctl status php-fpm.service -l

    请问这里面的哪个错误引起的不能启动 php-fpm



    systemctl status php-fpm.service -l
    ● php-fpm.service - The PHP FastCGI Process Manager
    Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Fri 2018-06-08 18:25:43 UTC; 13h ago
    Process: 2236 ExecStart=/usr/sbin/php-fpm --nodaemonize --fpm-config /etc/php-fpm.conf (code=exited, status=78)
    Main PID: 2236 (code=exited, status=78)

    Jun 08 18:25:43 servername systemd[1]: Starting The PHP FastCGI Process Manager...
    Jun 08 18:25:43 servername php-fpm[2236]: [08-Jun-2018 18:25:43] ERROR: [pool www] cannot get uid for user 'nginx'
    Jun 08 18:25:43 servername php-fpm[2236]: [08-Jun-2018 18:25:43] ERROR: FPM initialization failed
    Jun 08 18:25:43 servername systemd[1]: php-fpm.service: main process exited, code=exited, status=78/n/a
    Jun 08 18:25:43servername systemd[1]: Failed to start The PHP FastCGI Process Manager.
    Jun 08 18:25:43 servername systemd[1]: Unit php-fpm.service entered failed state.
    Jun 08 18:25:43 servername systemd[1]: php-fpm.service failed.
    laobaozi
        9
    laobaozi  
       2018-06-09 16:05:11 +08:00 via Android
    cannot get uid for user 'nginx'
    你是用那个用户来跑 fpm 的 默认不是 www 用户么
    laobaozi
        10
    laobaozi  
       2018-06-09 16:05:43 +08:00 via Android
    检查一下你的用户列表是否存在一个名为 Nginx 的用户
    dorothyREN
        11
    dorothyREN  
       2018-06-09 16:19:24 +08:00
    找不到 nginx 这个用户。。。。。。。。。。
    yummybitcoin
        12
    yummybitcoin  
       2018-06-09 16:42:47 +08:00
    @laobaozi @dorothyREN 目前用 root 还没有添加 nginx 这个用户 ,要添加一个吗?
    kmdd33
        13
    kmdd33  
    OP
       2018-06-09 16:58:54 +08:00
    @laobaozi @dorothyREN 刚才添加了 nginx 这个用户,启动成功,谢谢。
    laobaozi
        14
    laobaozi  
       2018-06-09 16:59:45 +08:00 via Android
    不是你现在进行操作的用户,而是 fpm 以哪个用户的身份运行
    检查一下你的配置文件
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2583 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 05:29 · PVG 13:29 · LAX 21:29 · JFK 00:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.