יום שלישי 16 אוקטובר 2007 12:21
I'm looking a native driver for SQL 2005 running under Linux/Unix!
Or Is accessible anywhere source code of the existing driver for php?
I tried FreeTDS, but it has some bugs and has no support.
Is there any good solution for this problem?
- הועבר על-ידי Microsoft JDBC Driver Product Team יום חמישי 19 אפריל 2012 20:35 topic is PHP (From:SQL Server Data Access)
יום שלישי 16 אוקטובר 2007 18:42
There currently is no native driver for SQL 2005 from Microsoft for Linux/Unix. The existing Microsoft PHP driver is not open source, and is Windows only. Sadly, there is currently no good solution to the problem of using native access for SQL Server from *NIX. However, SOAP does provide a simple mechanism for communicating with SQL Server from *NIX -- but it is not a native access method.
Hope that helps,
- סימון כתשובה בוטל על-ידי John C GordonMicrosoft Employee יום חמישי 01 דצמבר 2011 22:55
יום רביעי 17 אוקטובר 2007 16:04מנחה דיון
As John mentioned, there are no Microsoft supported native access providers on Unix/Linux. However, we are always looking for customer feedback on what is useful to them for accessing SQL Server.
I might suggest looking at PDO. I know PDO has a number of good drivers, and there might be support for a Unix ODBC driver in the ODBC PDO driver. Also, I know that PDO supports the FreeTDS driver, which as you mention is incomplete, but it currently the only solution I know of.
יום חמישי 05 נובמבר 2009 21:26PDO ODBC (and PHP iteself) needs some updating before it can properly support a lot of the 2005 and above data types including XML, MAX and National (Unicode) types. I implemented the Easysoft ODBC Driver for Linux with native ODBC calls in my PHP code (i.e. ripped out PDO) and it worked very well. All the data types I cared about were supported. I ended up working through three bugs with Easysoft in the XML, National and MAX data type handling and had to spend some time getting my ODBC configuraiton setup, but it is the only full-feature solution came across. C'mon Microsoft, a PHP driver that leverages the Native Client ODBC driver is nice to have, but you missed the majority of the PHP community. If your target was to make it easy to access SQL Server from PHP I would have to say that a claim of success must be deferred. If you were angling to get new Windows PHP development onto IIS and Windows, then bravo!
יום חמישי 01 דצמבר 2011 22:57
There is now an ODBC driver for linux available here:
It is 64 bit only, and targets RH5. As you noted, you can use PDO_ODBC to project this into the PHP layer. Note that PHP is by default 32 bit, and you would need a 64 bit build of PHP to work with this.
Hope that helps!
This post is provided 'as is' and confers no express or implied warranties or rights.
יום רביעי 04 אפריל 2012 20:04
I'm happy to see that this driver exists now, but does anyone have any idea how to get it to recognize a named instance? It "appears" to be working with the default instance on 2 different servers we have here, but specifying a different instance using the standard naming convention <server>\<instance> just gets a long wait and a timeout.
Using the specific port for the instance seems like the obvious choice, however when I do that - it still seems to only connect to the default instance somehow...
All I'm going by here is the fact that when pointed to port 1241 (port of a named instance here) it will not accept any server logins setup on that named instance, but a test login I created on the default instance is allowed to login, and then of course I get the error about not being able to open that database since it doesn't actually exist on that instance!
יום שני 09 אפריל 2012 19:35
Just kept guessing until I got it to work. Even though other documentation I was reading showed the DSN entry in odbc.ini with the Port entry for the named instance listed on it's own line separate from the Server entry like so:
Server = host.domain.com
Port = 1348
and listing the SQL Server instance in the Server entry like so got me nowhere:
Server = host.domain.com\INSTANCE
Port = 1348
adding the instance and the port in the Server entry seems to work:
Server = host.domain.com\INSTANCE,1348
יום שלישי 17 אפריל 2012 12:35
please could you refer the belo link.