tsql works, php doesn't, accessing MSSQL DB
Posted: Mon Sep 01, 2014 4:00 pm
freetds.conf:
[localz2]
host = 10.0.0.2
port = 1433
tds version = 8.0
Pretty straight forward, and works fine with tsql. With tsql I can connect and query the database.
PHP code:
$mssql_connection = mssql_connect('localz2','sa', 'password');
This insists:
Warning: mssql_connect(): Unable to connect to server:
I'm pulling my hair out, what is left of it, over this one. Why, oh why, would tsql work but mssql_connect in PHP not?
Note this has nothing to do with a web server, I'm running the php code in a console.
Slackware 14.1 32 bit
PHP 5.5.16
[localz2]
host = 10.0.0.2
port = 1433
tds version = 8.0
Pretty straight forward, and works fine with tsql. With tsql I can connect and query the database.
PHP code:
$mssql_connection = mssql_connect('localz2','sa', 'password');
This insists:
Warning: mssql_connect(): Unable to connect to server:
I'm pulling my hair out, what is left of it, over this one. Why, oh why, would tsql work but mssql_connect in PHP not?
Note this has nothing to do with a web server, I'm running the php code in a console.
Slackware 14.1 32 bit
PHP 5.5.16