Address already in use

yayaigo
$ php  start.php start  
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mcrypt.so' - /usr/lib64/php/modules/php_mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  Module 'msgpack' already loaded in Unknown on line 0
Workerman start in DEBUG mode
PHP Fatal error:  Uncaught exception 'Exception' with message 'Address already in use' in /var/www/html/Temptation/Peter2/GatewayWorker/Workerman/Worker.php:1211
Stack trace:
#0 /var/www/html/Temptation/Peter2/GatewayWorker/Workerman/Worker.php(404): Workerman\Worker->listen()
#1 /var/www/html/Temptation/Peter2/GatewayWorker/Workerman/Worker.php(321): Workerman\Worker::initWorkers()
#2 /var/www/html/Temptation/Peter2/GatewayWorker/start.php(38): Workerman\Worker::runAll()
#3 {main}
  thrown in /var/www/html/Temptation/Peter2/GatewayWorker/Workerman/Worker.php on line 1211

Fatal error: Uncaught exception 'Exception' with message 'Address already in use' in /var/www/html/Temptation/Peter2/GatewayWorker/Workerman/Worker.php on line 1211

Exception: Address already in use in /var/www/html/Temptation/Peter2/GatewayWorker/Workerman/Worker.php on line 1211

Call Stack:
    0.0001     225992   1. {main}() /var/www/html/Temptation/Peter2/GatewayWorker/start.php:0
    0.0035     723672   2. Workerman\Worker::runAll() /var/www/html/Temptation/Peter2/GatewayWorker/start.php:38
    0.0051     753056   3. Workerman\Worker::initWorkers() /var/www/html/Temptation/Peter2/GatewayWorker/Workerman/Worker.php:321
    0.0052     754328   4. Workerman\Worker->listen() /var/www/html/Temptation/Peter2/GatewayWorker/Workerman/Worker.php:404

請問要怎麼處理這問題?

7995 4 0
4个回答

yayaigo

use this code before binding:

if (!socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1)) {
echo socket_strerror(socket_last_error($socket));
exit;
}

fix address in use

  • 暂无评论
walkor 打赏
  • 暂无评论
yayaigo

php start.php restart 執行這個就正常了 thanks

  • 暂无评论
walkor 打赏

不客气

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