workerman启动失败,报错:Permission denied

用 php start.php start -d 启动 start.php 系统报错:
Fatal error: Uncaught exception 'Exception' with message 'Permission denied' in /var/public/workerman/Workerman/Worker.php:1212
Stack trace:
#0 /var/public/workerman/Workerman/Worker.php(404): Workerman\Worker->listen()
#1 /var/public/workerman/Workerman/Worker.php(321): Workerman\Worker::initWorkers()
#2 /var/public/workerman/start.php(37): Workerman\Worker::runAll()
#3 {main}
thrown in /var/public/workerman/Workerman/Worker.php on line 1212

然后我排查了一下,是Workerman/Worker.php的1208行:

$this->_mainSocket = stream_socket_server($this->transport.":".$address, $errno, $errmsg, $flags, $this->_context);

stream_socket_server方法执行失败。怎么解决??
已邀请:

walkor

赞同来自:

监听1024以下端口需要root权限,请切换成root用户 ubuntu/debian系统可以用sudo

walkor

赞同来自:

用root用户

要回复问题请先登录注册