mkswanson Posted November 27, 2013 Share Posted November 27, 2013 I'm having problems with a simple mssql_connect to a remote server. $ngLink = mssql_connect($ngServer, $ngLogin, $ngPassword); if ( !$ngLink ) { die('Connection to database failed!'); } If I point the server to a local instance of SQL 2008, the connection is successful. If I point the server to a remote instance of SQL 2008, I get a connection failed message. Both the remote and local PCs are Win2K8 with SQL 2008 standard. I have successfully connected to the remote instance using SQL management studio from my web server, so this does not appear to be a problem with the firewall or blocking based on IP. I have also successfully connected to the remote SQL instance from my dev box, through management studio and PhpStorm. I have enabled TCP/IP and named pipes in SQL configuration. I have tried capturing the last PHP error, which is a generic connection failed error, as well as the last MSSQL error, which is null since a connection isn't actually happening so MSSQL isn't generating an error. I have reviewed event viewer logs as well as other logs, and not been able to find anything that points me to the right direction. Any suggestions on where I can begin to look to troubleshoot? Quote Link to comment https://forums.phpfreaks.com/topic/284339-mssql_connect-woes/ Share on other sites More sharing options...
Barand Posted November 27, 2013 Share Posted November 27, 2013 mssql_ library is obsolete. Download the sqlsrv lib and documentation from Microsoft for MSSQL Server 2005 onwards http://www.microsoft.com/en-gb/download/details.aspx?id=20098 Quote Link to comment https://forums.phpfreaks.com/topic/284339-mssql_connect-woes/#findComment-1460394 Share on other sites More sharing options...
DrTrans Posted December 1, 2013 Share Posted December 1, 2013 $ngLink = mssql_connect($ngServer, $ngLogin, $ngPassword) or die(mssql_get_last_message()); print_r($ngLink); Let us know what the response is from that print statement. Quote Link to comment https://forums.phpfreaks.com/topic/284339-mssql_connect-woes/#findComment-1460831 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.