php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31746 mysql_connect returns: Can't create TCP/IP socket (10041)
Submitted: 2005-01-28 17:17 UTC Modified: 2005-01-28 20:35 UTC
From: gianni at comi dot it Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.0.3 OS: Windows 2003
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gianni at comi dot it
New email:
PHP Version: OS:

 

 [2005-01-28 17:17 UTC] gianni at comi dot it
Description:
------------
On Windows 2003 and IIS6, using php in cgi mode.
mysql_connect returns this "warning": Warning: Can't create TCP/IP socket (10041) in....

This happens only on Windows 2003.

Example:
mysql_connect( "localhost", "rightuser", "rightpass" );
mysql_connect( "127.0.0.1", "rightuser", "rightpass" );
mysql_connect( "remotehosname", "rightuser", "rightpass" );

I get always the same error


Reproduce code:
---------------
if (!($m_link = mysql_connect( $DBhostname, $DBuserName, $DBpassword ))) {
		db_err ("db connect error");
}


Actual result:
--------------
Warning: mysql_connect() [function.mysql-connect]: Can't create TCP/IP socket (10041) in F:\Webs\test.php on line 21


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-28 18:13 UTC] georg@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.


 [2005-01-28 18:38 UTC] gianni at comi dot it
Hi, thank you for reply.

No, it's a bug.
Only on windows 2003 server I have this problem.

It is not an anonymous web user security policy problem: anonymous web user can use network layer. For example: fopen(url) works fine, and it creates a tcp/ip socket like mysql_connect.

It is not a mysql problem:
From command prompt:
telnet localhost 3306 -> works
telnet 127.0.0.1 3306 -> works
telnet remoteserver 33060 -> works also on remote mysql server.

If is not a bug, what is it? PHP installations on other server other than windows 2003 with the same php.ini (the reccommended settings) work fine.
Only on w2k3 I have this issue.

Why changing from "localhost" to "127.0.0.1" the error doesn't change? With localhost it should use named pipes, with 127.0.0.1 tcp/ip. This is very strange.

Is there a different syntax for mysql_connect on windows 2003 system. From the manual parameter seems parameter are identical for all OSs.

Regards.
 [2005-01-28 20:26 UTC] gianni at comi dot it
Forget my last post.
Yes, it's not a bug. :)

It is an anonymous web user security policy matter.

Sorry.

Thank you all.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Sep 12 00:01:27 2024 UTC