Can't make socket_bind

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Can't make socket_bind

Postby hanpedro » 28. June 2011 05:14

I have a port problem for connecting xdebug. I've installed Kasperskry internet security 2011.

I want to open some port for connecting xdebug. I tried to open 9011 - actually i tried 9000 ~ 9010.

At kaspersky firewall, I opened 9011 at tcp and udp. But the 9011 port is occupied even though it's empty.


Xampp version is 1.7.3 and xdebug is 2.1.1.
And the socket_bind message is;

Code: Select all
Warning: socket_bind() [function.socket-bind]: unable to bind address
Dump $_COOKIE
Variables in local scope (#1)
$address =
 string '127.0.0.1' (length=9)
 
$client =
 Undefined
$port =
 int 9011
 
$sock =
 resource(2, Socket)
 
Unable to bind


Any helpful comment for this problem would be appreciated.
Thanks in advance.
hanpedro
 
Posts: 134
Joined: 09. February 2005 06:03
Operating System: SCientific Linux 6.1 x86

Re: Can't make socket_bind

Postby Sharley » 28. June 2011 06:08

Hello,

How did you check that the port was occupied and empty?

Download and try this little free no install CurrPorts app from here:
http://www.nirsoft.net/utils/cports.html
It will give you much more detail about the ports in use on your PC than the port checker included in 1.7.3 version of XAMPP.

This CurrPorts is the main program in the older XAMPP port checker and for some strange reason it was discontinued and actually there is now no port checker included in the latest versions of XAMPP.

CurrPorts also gives you some control over ports ie. it will allow you to kill selected processes on ports and it has heaps of info about what is occupying ports - a very useful tool for your needs.

Also by clicking a column heading you can sort how you view the details to make it easier to read - for example if you click on the column heading Local Address you will be able to see all the ports using 127.0.0.1 all in one group.

Did you check the Windows firewall also?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Can't make socket_bind

Postby hanpedro » 28. June 2011 08:30

Sharley/

I've read your posts or replies regading currports, and I checked this port using currports.

Image

About windows firewall, I disabled but Kaspersky's firewall is enabled.
hanpedro
 
Posts: 134
Joined: 09. February 2005 06:03
Operating System: SCientific Linux 6.1 x86

Re: Can't make socket_bind

Postby Sharley » 28. June 2011 08:44

Seems this is a common xdebug issue:
xdebug unable to bind to port
You may be able to find a solution in the above search results.

Have you tried temporarily disabling Kaspersky to see if it is responsible - you can re-enable it if there is still no change.

Sometimes a reboot after changing settings in Kaspersky helps.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Can't make socket_bind

Postby hanpedro » 28. June 2011 09:26

Sharley/

After disabling Kaspersky, the socket_bind is showing "waiting....."

The source is here to test port:

Code: Select all
<?php
$address = '127.0.0.1';
$port = 9011;
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
socket_bind($sock, $address, $port) or die('Unable to bind');
socket_listen($sock);
$client = socket_accept($sock);
echo "connection established: $client";
socket_close($client);
socket_close($sock);
?>


I tried restarting apache and rebooting also, but I could not make connection with xdebug's port.

If possible, would you please let me know which combination works with xdebug - windows 7 x64 and firewall + virus vaccine, apache, php, and mysql.
hanpedro
 
Posts: 134
Joined: 09. February 2005 06:03
Operating System: SCientific Linux 6.1 x86

Re: Can't make socket_bind

Postby Sharley » 28. June 2011 09:45

Not sure after reading some of these forum search results that xdebug even works with XAMPP 1.7.3 version especially if you have perhaps incorrect settings in the php.ini file.

I ran out of time reading them but you may have more time and a deeper interest in getting xdebug working in 1.7.3. - I would be interested in knowing if you are able to find a solution,

Usually when there is a port binding issue it is something using the port or it is blocked by security settings in firewall/antivirus/ZoneAlarm etc.

Good luck with it. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Can't make socket_bind

Postby hanpedro » 28. June 2011 09:54

Sharley/


Thanks for your time.
hanpedro
 
Posts: 134
Joined: 09. February 2005 06:03
Operating System: SCientific Linux 6.1 x86

Re: Can't make socket_bind

Postby JonB » 28. June 2011 14:08

If you want to know the 'likely issues', read this:

http://bravo.newnetenterprises.com/word ... d-debugger

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 100 guests