PHP Linux Drivers for Microsoft SQL Server

Dear Experts,

First, I hope my question doesn't get flagged as asking for an opinion. I have looked high and low for a definitive answer, and have yet to find one. Please give this consideration.

I have a unique opportunity to build a middle tier from scratch. Clean, brand new servers. The servers are running the current version of Ubuntu Linux. I have developed a framework of RESTful calls and now need to connect them to MS SQL Server 2012 on the back end.  I have been connecting to MS SQL, with perfect success, via the FreeTDS/mssql combo for ~10 years. Perhaps that "is" the best solution?

Microsoft develops and maintains drivers for Windows, which can be sourced here:

http://www.microsoft.com/en-us/download/details.aspx?id=20098

But, when it comes to Linux, the waters muddy considerably. I know the mssql.dll library for Windows has been deprecated, but I also see people comment the mssql library for Linux and Windows are not the same thing.

So, my question is simple - what is the best maintainable, and supported, solution for connecting PHP via Linux to Microsoft SQL Server today?

Thank you in advance.

Best,
Mike
mwheeler_fsdAsked:
Who is Participating?
 
Dave BaldwinFixer of ProblemsCommented:
The Only supported driver that I know of is here https://msdn.microsoft.com/en-us/library/hh568451%28v=sql.110%29.aspx  but it is Not a PHP driver and it is Not for Ubuntu but for Redhat and Suse Linux.  Freetds can be considered unsupported since the last date on their web site is 2011 and the last version is for SQL Server 2005.  That is what 'mssql.so' on Linux uses.  PHP 5.3 or greater on Windows requires the 'sqlsrv' driver.
0
 
mwheeler_fsdAuthor Commented:
Thank you again Dave! You'd helped me with a previous question regarding encryption. Incidentally, that was very helpful in solving the issue.

It would be nice to have more alternatives for PHP on Linux with MS SQL, but it seems this is it, at least for now.

Your help is greatly appreciated.

Best,
--Mike
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome.  Microsoft has waffled greatly on support for anything in Linux even though they did have a version of Unix at one time that they called Xenix.  After calling Linux 'evil' in about 2001, they came up with the MS SQL PHP driver a few years ago but Only in a Windows version.  I think someone using Redhat pressured them a great deal for the current ODBC driver.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.