php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20916 MS SQL: Unable to connect to server
Submitted: 2002-12-09 20:43 UTC Modified: 2002-12-10 10:07 UTC
From: CharlesK at netgaintechnology dot com Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.2.3 OS: Windows 2000 Server
Private report: No CVE-ID: None
 [2002-12-09 20:43 UTC] CharlesK at netgaintechnology dot com
Connecting to database fails when accessed with Netscape.  Below is my setup.  

IIS 5.0
 -Virtual Site
 -Directory security: basic
  -Anonymous Access: Disallowed
 -PHP 4.2.3

Database
 -MS SQL 2000

Client Netscape 7.0
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0

Calling the function 
mssql_connect($ip,$username,$password);
fails to connect to database

While accessing the same file with IE connects.

Not sure if this is a Netscape bug or PHP.  Just curious what could cause this behavior.

Thanks
Charles Killmer

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-09 23:24 UTC] sniper@php.net
If it works with some browser but not with another, it's a browser fault. Please don't report such bugs here.
(and btw. this REALLY can't be bug in mssql_* functions or anything else in PHP but some bug in your code)

 [2002-12-10 08:47 UTC] CharlesK at netgaintechnology dot com
This is not bogus.  The browser should not make any difference.  

Please test this case.
 [2002-12-10 08:48 UTC] CharlesK at netgaintechnology dot com
<?
   $username = 'dbusername';
   $password = 'dbpassword';

   $connection = mssql_connect('192.168.168.168',$username,$password);
?>
 [2002-12-10 08:59 UTC] sniper@php.net
Yes, browser can't possibly affect this.
Thus this is bogus. (propably some cache issue with NS)

 [2002-12-10 09:22 UTC] CharlesK at netgaintechnology dot com
But PHP is generating the error:
MS SQL:  Unable to connect to server

If it is entirely within Netscape, PHP should not display this error.

I am sorry for reopening this.
 [2002-12-10 09:40 UTC] sniper@php.net
If it works with IE or from command line, it CAN NOT BE A BUG IN PHP..

 [2002-12-10 09:54 UTC] CharlesK at netgaintechnology dot com
What else could be causing PHP to generate this error only in this case?

Sorry for continuing this but I do not believe this that PHP plays no part in this error.  I host around 40 sites all with php and most with database.  

I would just like an answer to what could cause this.  

Again sorry for reopening again.  This is my last attempt.
 [2002-12-10 10:07 UTC] iliaa@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.

It is possible that netscape sets a different host enviroment variable then the one set by IE and the one set in cli, which causes the SQL server reject the connection. That's just about the only thing I can come up with as the possible reason for this problem.
Try using the mssql_get_last_message() in the event of connection failure to determine why the connection fails. If it does due to a permission error, then my assumption as to the cause of the problem is likely to be correct.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 02:01:28 2024 UTC