I’m running php 5.5.15 from a RHEL6 server. I’m trying to connect to a remote SQL server but getting the below error.
odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect
I’ve installed php-pdo_odbc added extension=pdo_odbc.so to my php.ini file. I’ve tried to follow some google topics and I’m not sure what I should be doing. Do I need to install unixODBC outside of the php-pdo_odbc driver? Is there other setup needed. There doesn’t seem to be great direction out there for a newb for setting this up. Any suggestions or links would be appreciated.
Trying to connect this way. Not sure if the driver is correct as I’m not sure what it should be set to on RHEL6.
$ods_conn = odbc_connect(“Driver={SQL Server Native Client 10.0};Server=$odsHOST;Database=$odsDBname;”, $odsUN, $odsPW);
if (!$ods_conn){
if (phpversion() < ‘4.0’){
exit(“Connection Failed Php Error : . $php_errormsg” );
}
else{
exit(“Connection Failed ODBC Error:” . odbc_errormsg() );
}
}