ghedipunk / PHP-Websockets

A Websockets server written in PHP.
BSD 3-Clause "New" or "Revised" License
913 stars 375 forks source link

Warning: socket_bind(): unable to bind address [98]: #73

Closed mohamedagamy closed 8 years ago

mohamedagamy commented 8 years ago

when I try to open testwebsock.php in my localhost in linux

!/usr/bin/env php

Warning: socket_bind(): unable to bind address [98]: Address already in use in /var/www/html/websocket/websockets.php on line 23 Failed: socket_bind()

ghedipunk commented 8 years ago

Try changing the following line in testwebsock.php to have a different port number:

$echo = new echoServer("0.0.0.0","9000");

9001 might be a good place to start.

Take a look at what ports are currently in use on your server if you don't want to just guess at which one might be open.

You'll also have to edit client.html with the updated port number.

Closing because this is not an issue with the library, it's a specific conflict with a server's configuration. If you still need support, please feel free to continue the discussion.

mohamedagamy commented 8 years ago

Thank you Worked with me :+1:

codem360 commented 6 years ago

PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/websoc/websockets.php on line 23 Failed: socket_bind()

I have find this issue on my aws server pls help me. Thanks in advance.

ghedipunk commented 6 years ago

Please do not comment on closed threads with new errors.

Especially errors that show that you haven't done any basic troubleshooting like running netstat to see what ports are already in use.

On Sun, Apr 15, 2018 at 9:55 AM codem360 notifications@github.com wrote:

PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/websoc/websockets.php on line 23 Failed: socket_bind()

I have find this issue on my aws server pls help me. Thanks in advance.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/ghedipunk/PHP-Websockets/issues/73#issuecomment-381421019, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPPPj6cKVCl6TJe-KoNV7tXPeL_hwfxks5to3tygaJpZM4H5RuL .

git-TXX commented 5 years ago

PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/websoc/websockets.php on line 23 Failed: socket_bind()

I have find this issue on my aws server pls help me. Thanks in advance.

check your real ip with command "ifconfig" 有可能因为当前所在的是内网,只能识别内网ip

tiagoarrf commented 1 year ago

PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/websoc/websockets.php on line 23 Failed: socket_bind()

I have find this issue on my aws server pls help me. Thanks in advance.

$address = 'localhost';

ghedipunk commented 1 year ago

Use 0.0.0.0. And read the PHP manual's entry on socket_bind().

On Tue, Dec 20, 2022, 8:34 AM tiagoarrf @.***> wrote:

PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/websoc/websockets.php on line 23 Failed: socket_bind()

I have find this issue on my aws server pls help me. Thanks in advance.

$address = 'localhost';

— Reply to this email directly, view it on GitHub https://github.com/ghedipunk/PHP-Websockets/issues/73#issuecomment-1359573303, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB46PSCRZGQOOLIV6EWQOLWOHGWPANCNFSM4B7FDOFQ . You are receiving this because you modified the open/close state.Message ID: @.***>