用 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方法执行失败。怎么解决??
监听1024以下端口需要root权限,请切换成root用户 ubuntu/debian系统可以用sudo
我是redhat的主机,监听1024以上的端口权限也不够,sudo也不行
用root用户