Jump to content

[SOLVED] mssql_connect() not connecting


knowram

Recommended Posts

I am getting a Warning: mssql_connect(): Unable to connect to server: error and when I look at the log from my router/firewall I don't even see an attempt to connect. Is there some configuration in the php.ini file I need to check or anywhere else? phpinfo() shows a mssql section so i assumed that it was installed correctly.

 

Thanks for the help.

Link to comment
https://forums.phpfreaks.com/topic/73946-solved-mssql_connect-not-connecting/
Share on other sites

Here is the connect statement. I am having the problem connecting from a test server. The production server work great.

The production server is a windows server running IIS. My test box is an apple with Apache installed.

 

mssql_connect("idc01-netwug.associa.corp", "user", "password") or
 die ("Could not connect to database");
mssql_select_db("WhatsUp") or
die ("Could not select database");

 

Thanks for the help. I am out of ideas.

 

 

All I cant figure is that you have your DB details wrong

 

This part of the code is an exact copy form the production server.

 

Can you try

mssql_connect("localhost", "user", "password")


See if this works.

You are trying to connect to a database on your server, right?

 

No the MSSQL server is a different box. Is there something in a configuration file somewhere that lets you connect to remote servers?

 

Thanks again for the help

 

There are 5 different servers involved

Production web server / SQL server (virtual box)

Old production web server (to be decommissioned)

Test web server / Mysql server

1 SQL server

 

 

From the production box I can connect to the MySQL database and both MSSQL databases. From the old production box I can also connect to the MySQL and both MsSQL databases. But from the test box I can only connect to the MySQL server on its self.

 

And yes I have admin access to all these.

 

 

 

So it looks like you did not configure it right in configuration file.

 

I am sorry I am not a server guy.

 

You can try here, but it deals with MySql, but maybe someone there can help you figure it out or guide you to MsSQL configuration support forum.

 

http://www.phpfreaks.com/forums/index.php/board,63.0.html

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.