#26988 [Opn->Bgs]: Cannot connect to database while offline
| From: | sniper@php.net | Date: | Wed, 21 Jan 2004 11:07:07 +0000 |
| Subject: | #26988 [Opn->Bgs]: Cannot connect to database while offline | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-53685@lists.php.net to get a copy of this message | ||
ID: 26988
Updated by: sniper@php.net
Reported By: david dot nordenberg at uppsala dot se
-Status: Open
+Status: Bogus
Bug Type: MSSQL related
Operating System: winxp sp1/mssql 2000 sp3
PHP Version: 4.3.5RC1
New Comment:
It's not PHP bug but some bug with the underlying DBLIB.
Make sure you have installed all the patches and latest MDAC
components:
http://www.microsoft.com/data/
http://www.microsoft.com/sql
Also, read the various user comments found on page:
http://www.php.net/manual/en/function.mssql-connect.php
Previous Comments:
------------------------------------------------------------------------
[2004-01-21 04:22:26] david dot nordenberg at uppsala dot se
Description:
------------
I connect to a localy installed database trough the servername
"localhost" which resolves to 127.0.0.1 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 "127.0.0.1" 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 127.0.0.1] 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/
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26988&edit=1