Brandon Garnett
asked on
Connect to MS-SQL server from Linux/PHP
I'm migrating a website over to a LAMP stack from a windows machine. Everything is going smoothly except for all the PDO exceptions. The PDO was using the "sqlsrv" driver, however that driver is no longer found. (We are moving to a debian server, and I can't find the driver in the debian package repos).
Anyways I need to know how either where to find a linux build for the sqlsrv driver. Or an alternative driver that does support linux. Thanks.
Anyways I need to know how either where to find a linux build for the sqlsrv driver. Or an alternative driver that does support linux. Thanks.
Linux does not have an equivalent driver. There is the old 'mssql' driver but it does not have all the features that 'sqlsrv' does. This article https://www.experts-exchange.com/questions/27424576/Looking-for-examples-on-connecting-to-MS-SQL-Server-with-freetds-in-C.html is the best description I have for the process on Linux.
On Linux freetds, which SQL server is being used, which Linux is are you using?
... and long learning to not copy and paste DB connection strings around the application.
You can use Microsoft ODBC Driver for SQL Server on Linux or download the Linux version for Microsoft JDBC Drivers for SQL Server.
ASKER
Thanks everybody, So far I see that mssql and JDBC are valid drivers. But how do I install then to be used in the PDO driver?
I'm using Debian Jessie with apache2.
I'm using Debian Jessie with apache2.
What stands for PDO?
ASKER
PDO: PHP Datbase Object
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.