#26988 [NEW]: Cannot connect to database while offline
| From: | david dot nordenberg at uppsala dot se | Date: | Wed, 21 Jan 2004 09:22:26 +0000 |
| Subject: | #26988 [NEW]: Cannot connect to database while offline | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-53680@lists.php.net to get a copy of this message | ||
From: david dot nordenberg at uppsala dot se
Operating system: winxp sp1/mssql 2000 sp3
PHP version: 4.3.5RC1
PHP Bug Type: MSSQL related
Bug description: Cannot connect to database while offline
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 bug report at http://bugs.php.net/?id=26988&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26988&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26988&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26988&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26988&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26988&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26988&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26988&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26988&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26988&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26988&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26988&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26988&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26988&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26988&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26988&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26988&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26988&r=float