|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26988 Cannot connect to database while offline
Submitted: 2004-01-21 04:22 UTC Modified: 2004-01-21 06:07 UTC
From: david dot nordenberg at uppsala dot se Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.3.5RC1 OS: winxp sp1/mssql 2000 sp3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: david dot nordenberg at uppsala dot se
New email:
PHP Version: OS:


 [2004-01-21 04:22 UTC] david dot nordenberg at uppsala dot se
I connect to a localy installed database trough the servername "localhost" which resolves to which I can ping. Now if I pull my network cable, php loses the ability to connect to the database, no login attempts is registred by the sql server and php thinks the server does not exist. I can even change the servername value of mssql_connect to "" but it still won't connect. Other applications can connect just fine to the sql server while not having any network interfaces up but not php, I think I saw the same problem with PHP 5 snapshot about a week old.

Reproduce code:
$server = "localhost";
$conn = mssql_connect($server, $_SESSION['login'], $_SESSION['passwd']);

Expected result:
mssql_connect to work

Actual result:
[client] PHP Warning:  mssql_connect() [<a href='function.mssql-connect'>function.mssql-connect</a>]: Unable to connect to server:  localhost in C:\Program\Apache Group\Apache2\htdocs\index.php on line 31, referer: http://localhost/


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-21 06:07 UTC]
It's not PHP bug but some bug with the underlying DBLIB.
Make sure you have installed all the patches and latest MDAC components:

Also, read the various user comments found on page:

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 02:01:27 2024 UTC