1

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?!

2
  • Probably not the answer you seek but do consider using a Windows box. Windows + MySQL = common, Windows + MSSQL... not really. Commented Oct 27, 2012 at 19:40
  • Honestly, I think you're making your life harder with this combination. If you're forced to use MSSQL, then your path of least resistance is to run your web server and PHP code on Windows as well. Commented Oct 27, 2012 at 19:48

4 Answers 4

3

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

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

0

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

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.