php 无法绑定地址'127的侦听套接字,0.0.1:9000 ':使用中的地址(98)

6ojccjat  于 2023-04-28  发布在  PHP
关注(0)|答案(1)|浏览(121)

我无法在supervisor中启动php7-fpm。错误日志:
无法绑定地址'127的侦听套接字。0.0.1:9000 ':地址〉使用(98)
在浏览器中:
localhost:8090错误:502错误网关
netstat -tulnp

tcp     0    0 0.0.0.0:8080         0.0.0.0:*      LISTEN      13/nginx
tcp     0    0 0.0.0.0:80           0.0.0.0:*      LISTEN      13/nginx
tcp     0    0 0.0.0.0:8090         0.0.0.0:*      LISTEN      13/nginx
tcp     0    0 :::3000              :::*           LISTEN      11/node
tcp     0    0 :::7000              :::*           LISTEN      10/node

辅助系统

/ # ps aux
PID   USER     TIME  COMMAND
    1 root      0:00 {bootloader} /bin/sh /boot/bootloader
    8 root      0:01 {supervisord} /usr/bin/python2 /usr/bin/supervisord
   62 root      0:00 /bin/sh
   92 root      0:00 nginx: master process /usr/sbin/nginx
   93 root      0:00 nginx: worker process
   94 root      0:00 nginx: worker process
  122 root      0:00 ps aux

php-fpm.d/www/conf

[www]

user = nobody
group = nobody

listen = 127.0.0.1:9000

pm = dynamic

pm.max_children = 5

pm.start_servers = 2

pm.min_spare_servers = 1

pm.max_spare_servers = 3

/etc/nginx/sites-enabled/page1

server {
        listen      8090;
        root        /usr/bin;
        server_name localhost;
        access_log  /dev/null;
        error_log   /dev/null;

        location / {
                proxy_pass http://127.0.0.0:7000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Fowarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Fowarded-Proto $scheme;
                proxy_cache_bypass $http_upgrade;

               try_files $uri $uri/ =404;
        }

        location ~ \.(gif) {
                root /var/lib;
        }

}

/etc/nginx/sites-enabled/page2

server {
  server_name localhost;
  root        /www;
  index       index.php;
  access_log  /dev/null;
  error_log   /dev/null;

  client_max_body_size 100M;
  fastcgi_read_timeout 1800;

  location / {
    try_files $uri $uri/ /index.php$query_string;
  }

  location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    expires       max;
    log_not_found off;
    access_log    off;
  }

  location ~ \.php$ {
    try_files     $uri =404;
    include       fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass  127.0.0.1:9000;
  }
}

错误在哪里?我不知道。

cnwbcb6i

cnwbcb6i1#

在我的例子中,它是PHPStorm,在端口9000上监听xdebug。
您可以通过以下方式停止此操作:设置〉PHP〉调试
并点击第3项下的“停止监听”。在顶部的列表中。
为了避免这样的问题,您应该重新配置xdebug和PHPStorm以使用不同的端口。

相关问题