I have added the sqlsrv folder to includes/database but the option does not show up during installation?

Is there something I need to do? I have the mssql enabled and it shows up in my phpinfo() but still not getting the option when running the install?

Thanks
James

Comments

jamesodmitchell’s picture

Does this only work on IIS is my question? I have tried it now on a Windows XP machine with XAMPP and still not showing the driver in the install screen?

Please advise.

James

damien tournoud’s picture

The PDO driver for SQL Server only works on the Windows platform. It will work regardless of the web server you are using, and should theoretically (as far as I know) work on Windows XP.

damien tournoud’s picture

See the exact system requirements here:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=80e44913-24b...

You are most likely missing th SQL Server 2008 R2 Native Client.

heine’s picture

You also need a PHP PDO driver for SqlServer:

http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx

bg1’s picture

I need a MSSQL driver for Drupal running on Linux (not for the Drupal database, but for a MSSQL database running on another server in our environment that contains all of the Transaction Processing data which is run through other dedicated applications.

Can anyone tell me what works?

Thanks in advance.

designingsean’s picture

I believe the question the original poster had was this:

Does the Drupal 7 SQL Server driver that is being developed here only work on Windows PHP installs? His question is the same as mine.

I have PHP on a Linux box with Apache, and I have a mssql driver installed and active (FreeTDS). I have placed the sqlsrv folder provided by this project in the includes/database folder as instructed.

Yet when I am stepping through the install for Drupal 7, I do not have the option to use SQL Server, as the instructions say should be available.

Thoughts?

kung_fu_mike’s picture

The PDO sql srv method will not work on Linux/MAC connectiong to a SQL Server database. The way Drupal determines what databases are available to you on install, is to look at the installed drivers, I *think* by file name if I remember correctly. The it cross references that with all of the php pdo_WHATEVER libs you have installed.

If you wanted a dblib driver to show up (so you could connect to to SQL Srv). you would have to:
1) rename the driver file and the hard reference of the string 'sqlsrv' to 'dblib'
2) you would have to gut the PDO class variable and function calls from the lib. I don't know how hard it would be, I haven't had time. I, tragically, got forced on to IIS

mtift’s picture

Subscribing

damien tournoud’s picture

This driver currently relies on the Microsoft PDO driver for SQL Server, as clearly stated on the project page.

I am open to making this work on other access methods for SQL Server, but my hopes are not high it will work. What we need at the minimum is:

* Proper support for binary columns
* Proper support for unicode (nvarchar, ntext) columns
* Consistent support for transactions

Last time I looked into this (but it was at least one year ago), the dblib/freetds driver was totally unable to properly fetch and store data in unicode columns. It might have changed. In that case, there might be luck.

Renee S’s picture

Hi Damien, thanks for the update. Now that Microsoft has released the SQL ODBC Server Driver for RHEL, is this looking more likely now?

rawl747’s picture

Anything new on this issue? I too attempted to get this combination to work but ran into the issue that the PHP calls that Drupal7 wants to make only work with the version of the database drivers (sqlsrv & PDO_sqlsrv) that run on Win platforms. The deprecated open source libs for MS SQL Serverl (mssql and PDO_mssql)) that run on Linux (Ubuntu) will not play nice with the database includes that come with the MS sponsored Drupal7 installation (Aquia Drupal).

There is some demand from clients out there for a cross platform solution with everything but the database running on a LAMP stack (minus the M) and an MS SQL Server database.

I'd love to see someone with more Linux knowledge than I try, to tweak the source code files MS has provided for their PHP drivers replacing the references to Win includes files with Linux equivalents and trying for a successful compile.

That or finally see Microsoft come out with PHP drivers for Ubuntu that will work and accept sqlsrv and PDO_sqlsrv calls.

This approach of trying to own the whole shebang isn't cool MS! Play nice in the sandbox please...

marquito’s picture

hey guys... we already have a Moodle installation working in this scenario: linux + php5 + freetds + sql server.

but we just can't figure out how to link drupal to sql server in the same manner.

what configs should we use? any ideas?

we're going crazy with this because it seems so simple yet it does not work.

Remon’s picture

In an effort to mitigate connecting to sql server from*nix enviroments, I created a dblib fork.
I only renamed "sqlsrv" occurrences to "dblib" and -unfortunately- had to comment out code snippets that do not work with dblib. I'm using it for a Drupal installation running on mac os and connected to a sql server 2008 and it has been ok for me so far.

andypost’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev

@Remon how does it works with charsets?
Also MS now have a native odbc drivers for linux http://www.microsoft.com/en-us/download/details.aspx?id=28160

FreeFox’s picture

I don't know if this will help you but probably there will be some useful information in it.
http://drupal.org/node/1892310

andypost’s picture

@FreeFox thanx a lot, it works

chandan_jha18’s picture

Issue summary: View changes

@FreeFox, in your post with the steps, when I go through the settings.php code you posted for connection information, it looks like it needs an existing setup with mysql and then with some module you want to pull the data into sql server.

What if I have a brand new setup for Drupal first time on a Linux box? I don't think we can touch settings.php as this is the file which gets populated when from the Drupal administration, we choose a database of our choice and then populate it. If I edit settings.php file manually, it gives me an error ' Drupal database already set up'

I can see Microsoft SQL Server as an option, have configured FreeTDS, registered a DSN and can use that DSN through iSQL. I am not able to go beyond it.

Thanks
Chandan

david_garcia’s picture

Status: Active » Closed (won't fix)

The sqlsrv team has stated that the next pdo driver will be Linux compatible. Only for PHP7 and beyond though. There is nothing we can do to fix this here.

andypost’s picture

The only way now is use https://www.drupal.org/project/dblib

KG2’s picture

Hi andypost and everyone else,

If https://www.drupal.org/project/dblib is the only way to connect from drupal (ubuntu, mysql) to an external mssql database - what has happened to it?
Where is the download and instructions?

I am very confused. I followed these instructions https://blog.thesysadmins.co.uk/ubuntu-server-connect-to-mssql-via-php.html and my ubuntu server can connect to mssql (php - from both command line, browser and Adminer), but not the drupal site.

I added the connection to settings.php and would like to use Views Database Connector but everything I read for mssql points to versions of dblib that are no longer available.

I would appreciate any assistance