|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22287 mssql_connect always returns 'Unable to connect to server'
Submitted: 2003-02-18 21:44 UTC Modified: 2003-02-18 22:38 UTC
From: lidiexy at fim dot uclv dot edu dot cu Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.2.3 OS: WindowsXP Pro
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: lidiexy at fim dot uclv dot edu dot cu
New email:
PHP Version: OS:


 [2003-02-18 21:44 UTC] lidiexy at fim dot uclv dot edu dot cu
When I try to run this script:
  mssql_connect('mssql.localserver', 'myuser', 'mypass') or die('Nope');

I always get a warning saying that it was unable to connect to server, and the Nope message. I also tested with my mssql IP instead of the dns.

My web server: Apache 2.0 PHP Filter 4.2.3. WinXP Pro.
My MSSQL 2000 over Windows 2000 Advanced Server.

In the webserver I run the Query Analizer against my mssql and it works. The myuser user is a mssql's one.

Any ideas?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-18 22:38 UTC]
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 as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

There could be two resons for this:

1) The server you are contacting could not be found. 'mssql.localserver' is not a valid server name. The server name can be a netbeui name, a tcp/ip address or host name or an alias configured with the client network utility.

2) The SQL server is configured to allow trusted connections only. You can either reconfigure the SQL server or use the php.ini option mssql.secure_connection = On. You will have to make sure the user running the Apache process is a trusted user.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 04:01:28 2024 UTC