1
I have a hosting that I need to connect to a bank Sqlserver external in a php system I am creating. I insert all data correctly but always gives connection error showing the message:
mssql_connect()
: Unable to connect to server:xxxxxxxxx
Is there some sort of incompatibility in my hosting for connections to the Microsoft bank? Need something else, a plugin or something like that? In Mysql it normally connects.
Is the server local? or cloud? if local, is the server installed on your machine? or on some server within the LAN network? if you are on your machine, are you using the right instance? example: 172.16.0.13 SQLEXPRESS? If it is in LAN have you checked if SQL is enabled to work in network? if it’s cloud-based, we usually have to release our IP to make the connection.
– Thomas Erich Pimentel
Hi Thomas. It’s not on my machine. The system is on one of our servers and the bank is on a client server. I haven’t checked if the IP is cleared yet, I’ll do it now. Thanks for the tip.
– Matheus Godoi
Matheus, check the port forwarding on your client, check the firewall rules by releasing by TCP 1433 (SQL Default Port)
– Thomas Erich Pimentel
Before trying to connect with your code, try using SQL Server Management Studio. If it fails, you may not be using the correct parameters or the connection to the bank may not be open.
– lpacheco
Like this your connection string?
– Marco Souza
Marconcilio, the error appears at the beginning of the script. $host = 'http://www.endereco.ddns.net'; $user = 'user'; $pass= 'password'; mssql_connect($host, $user, $pass);
– Matheus Godoi