I have been trying to get MsSQL recognised on my linux based web server which currently has Ubuntu installed on it. I have followed the steps shown on this post but i have not managed to get it to work:
Connect PHP to MSSQL via PDO ODBC
Everytime i run the following command in PHP i simply ohly get mysql as though it only picks up the mysql.so file:
foreach (PDO::getAvailableDrivers() as $driver)
{
echo $driver . '<br />';
}
Does anybody know how i can get it to output the odbc driver also? The reason i ask is because the PHP application i am trying to run has the following code in it which i am trying to get around as it's written for Microsoft Server by the looks of it:
if (extension_loaded('pdo_sqlsrv')) $this->extension = 'pdo_sqlsrv';
else if (extension_loaded('pdo_odbc')) $this->extension = 'pdo_odbc';
If i comment the above code out the pdo statement doesn't connect for the reason i mentioned above due to no odbc driver
I tried to install freetds and configure it but i couldn't get it working as odbc doesn't show in the drivers list;
Reading package lists... Done Building dependency tree Reading state information... Done tdsodbc is already the newest version. unixodbc is already the newest version. 0 to upgrade, 0 to newly install, 0 to remove and 171 not to upgrade.
anybody got any suggestions on reading from MsSQL with PHP 5.4 on linux (Ubtuntu)?