Page 1 of 1

Trouble connecting to remote SQL server

Posted: Mon Nov 24, 2003 12:06 pm
by Swede78
I cannot seem to connect to a remote MS SQL server. I have my php.ini configured to support mssql. I found on php.net that this may be my problem:
Just a little comment that I would like to add:

If you intend to access MS SQL server remotely, you need to install SQL Server Client Tools on the system which hosts your PHP code.
Does anyone know where I can get SQL Server Client Tools, and if it's free? Maybe that's a stupid question, seeing that it is Micro$oft. But, I can't even find this at microsoft.com. I assume they would have it, but I could be wrong.

Here is my connection code:

Code: Select all

<?php
$hostname_connPSUser = "********.com";
$database_connPSUser = "Database";
$username_connPSUser = "Username";
$password_connPSUser = "Password";
$connPSUser = mssql_connect($hostname_connPSUser, $username_connPSUser, $password_connPSUser) or die("Couldn't connect to SQL Server on $hostname_connPSUser");
?>
And here is the error in my log:
PHP Warning: mssql_connect() [<a href='http://www.php.net/function.mssql-conne ... connect</a>]: Unable to connect to server: *******.com in C:\Inetpub\*****.php on line 71

Any suggestions would be greatly appreciated.

Posted: Mon Nov 24, 2003 12:26 pm
by microthick
You can download the demo for MS SQL Server:
http://www.microsoft.com/downloads/deta ... layLang=en

The server stops working after a while, but the client tools will always work.

Posted: Wed Nov 26, 2003 9:06 am
by Swede78
Thank you, I'll give it a try.