1
Reply

MS Sql Connection using PHP in Linux

Dadu Da

Dadu Da

Jun 12 2017 9:05 AM
220
I am tring to access MS Sql Server from linux os,
I am successfuly connect MS Sql Server,
 
I alredy set DSN by configure files "odbcinst.ini" and "odbc.ini" 
 
in "odbcinst.ini" file
 [FreeTDS]
Description = Freetds v 0.95
Driver=/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
 
in  "odbc.ini"
[MSSQLServer]
Driver = FreeTDS
Trace = No
Server = IP Address
Port = 1433
Database = Data Base Name
User = login
Password = password
 
on command prompt of linux I can connect MS SQl Server and fetch data succesfuly. 
 
but when I try connect in php,
I tried both way to connect MS Sql Server
1> $conn = sqlsrv_connect( $serverName, $connectionOptions )
2> $conn = odbc_connect($dsn,$user,$password);
 
both time nothing get (error or message). 

Answers (1)