使用[::]监听ipv6地址报错

eaglexpf

在本地搭建的centos虚拟机上使用
new Worker("http://:$port");
的方式启动没有问题;
上传到阿里云服务器上后返回的错误信息如下:

Workerman start in DEBUG mode
PHP Warning: stream_socket_server(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /data/wwwroot/RocApiWorker/vendor/workerman/workerman/Worker.php on line 1445

Warning: stream_socket_server(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /data/wwwroot/RocApiWorker/vendor/workerman/workerman/Worker.php on line 1445
PHP Warning: stream_socket_server(): unable to connect to tcp://:20001 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /data/wwwroot/RocApiWorker/vendor/workerman/workerman/Worker.php on line 1445

Warning: stream_socket_server(): unable to connect to tcp://:20001 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /data/wwwroot/RocApiWorker/vendor/workerman/workerman/Worker.php on line 1445
PHP Fatal error: Uncaught Exception: php_network_getaddresses: getaddrinfo failed: Name or service not known in /data/wwwroot/RocApiWorker/vendor/workerman/workerman/Worker.php:1447

将监听方式改为
new Worker("http://0.0.0.0:$port");
后正常启动;
求原因或者思路~~

5415 1 0
1个回答

walkor 打赏

阿里云不支持ipv6

  • 暂无评论
年代过于久远,无法发表回答
×
🔝