knowram Posted October 19, 2007 Share Posted October 19, 2007 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. Quote Link to comment Share on other sites More sharing options...
Wes1890 Posted October 19, 2007 Share Posted October 19, 2007 Show me your code Quote Link to comment Share on other sites More sharing options...
knowram Posted October 19, 2007 Author Share Posted October 19, 2007 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. Quote Link to comment Share on other sites More sharing options...
Wes1890 Posted October 19, 2007 Share Posted October 19, 2007 All I cant figure is that you have your DB details wrong Quote Link to comment Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 Can you try mssql_connect("localhost", "user", "password") See if this works. You are trying to connect to a database on your server, right? Quote Link to comment Share on other sites More sharing options...
knowram Posted October 19, 2007 Author Share Posted October 19, 2007 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 Quote Link to comment Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 Is this on a virtual host account or it is a dedicated server? Are you the owner and the administrator of the HHTP and MsSQL servers? Quote Link to comment Share on other sites More sharing options...
knowram Posted October 19, 2007 Author Share Posted October 19, 2007 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. Quote Link to comment Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 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 Quote Link to comment Share on other sites More sharing options...
knowram Posted October 19, 2007 Author Share Posted October 19, 2007 Thanks I will repost there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.