Reputation: 4767
I've got a problem and there doesn't seem to be a strait forward solution.
I'm running a Linux server with PHP and need to connect to a MSSQL database on a remote server (I don't have control over this server). Speaking to my host, they say that it's not possible eto install the MSSQL extensions on a linux box as they are only available on Windows Servers. So, I'm looking to see what other options i have.
Any ideas how I can do this on a linux box?!
Upvotes: 1
Views: 6026
Reputation: 1420
you have to do it via an ODBC connection.. odbc_connect() etc etc.. Microsoft has drivers for this http://www.microsoft.com/en-gb/download/details.aspx?id=28160.. (edit) I have done this without any of the issues posted... the php.net website for odbc_connect even gives mSSQL examples in the manual http://php.net/manual/en/function.odbc-connect.php
Upvotes: 1
Reputation: 29462
it's not possible eto install the MSSQL extensions on a linux box
They lied. It is possible, but it requires FreeTDS
to compile.
Other solution is to use other host (with windows) to act as proxy to MSSQL server, and communicate with it by SOAP/REST
Upvotes: 3
Reputation: 47945
Commonly a database module is installed but in your case you could try to use a REST-API to talk with the MSSQL database. But that must be installed on a second server e.g. the database server itself.
Upvotes: 0
Reputation: 740
Maybe this helps, send it to your server host:
http://pointbeing.net/weblog/2010/05/successful-microsoft-sql-server-support-for-php-on-linux.html
Upvotes: 0