AbydosGater Posted April 22, 2007 Share Posted April 22, 2007 Hi, I am running apache and php on my computer with a static ip of 192.168.1.136 but todays ip is http://86.42.77.153/ so its running on that. and everything works there fine. But if i open the PHP binary and run a script that binds a socket to 192.168.1.136 it works fine and i can connect with telnet. But other people cannot connect. So i thought if http is running 86.42.77.153 i could bind the socket to 86.42.77.153. But when i try that i get my "or die("Cannot Bind Socket");". Does anyone know what i bind to so that outside users can connect to my socket? Andy Link to comment https://forums.phpfreaks.com/topic/48154-solved-sockets-binding-and-accessing-problem/ Share on other sites More sharing options...
Navarr Posted April 22, 2007 Share Posted April 22, 2007 Try binding to 0.0.0.0 192.168.1.136 is a LOCAL Ip Address. Computer's that are accessing your server via that IP, will be able to get in. Others, will not. Why its not binding to 86.42.77.153 I'm not sure, but try for 0.0.0.0. Also, the problem could be that something else is running on that port for the outside IP, and that could be your binding problem. Link to comment https://forums.phpfreaks.com/topic/48154-solved-sockets-binding-and-accessing-problem/#findComment-235405 Share on other sites More sharing options...
AbydosGater Posted April 22, 2007 Author Share Posted April 22, 2007 Ok I tried binding to 0.0.0.0 and the script ran and it awaited the connections. But i got a friend to try to connect to either: telnet://192.168.1.136:1234 OR telnet://86.42.77.153:1234 (1234) being the port(DUH your not stupid sorry) But neither of them are connecting for him. I can connect via the 192.168.1.136 but noone else. Anyone know how i can get it so that outside users can connect. I know the ports are forwarding and everything because http://86.42.77.153 works. But the sockets are not working Link to comment https://forums.phpfreaks.com/topic/48154-solved-sockets-binding-and-accessing-problem/#findComment-235439 Share on other sites More sharing options...
Navarr Posted April 22, 2007 Share Posted April 22, 2007 If there is a router on your end, did you port forward 1234? And, if you have a firewall running, does it allow PHP through this port? Link to comment https://forums.phpfreaks.com/topic/48154-solved-sockets-binding-and-accessing-problem/#findComment-235464 Share on other sites More sharing options...
AbydosGater Posted April 22, 2007 Author Share Posted April 22, 2007 Ok firstly, Yes there is a router, and no i havnt forwarded the ports?!? I know how to do that but what settings do i use for it? Any online tutorials ill check portforward.com but i think they only have for certain programs not specific things. And no i dont have a firewall. Andy Link to comment https://forums.phpfreaks.com/topic/48154-solved-sockets-binding-and-accessing-problem/#findComment-235495 Share on other sites More sharing options...
Navarr Posted April 22, 2007 Share Posted April 22, 2007 What type of router do you use? Link to comment https://forums.phpfreaks.com/topic/48154-solved-sockets-binding-and-accessing-problem/#findComment-235511 Share on other sites More sharing options...
AbydosGater Posted April 22, 2007 Author Share Posted April 22, 2007 Its ok i just forwarded port 5555 on TCP and now people are connecting! Thank you guys so much, would never have thought about forwarding that port Solved Link to comment https://forums.phpfreaks.com/topic/48154-solved-sockets-binding-and-accessing-problem/#findComment-235515 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.