0

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 7 to sql server in the same manner.

what configs should we use? anyone ever tried this?

drupal simply does not show up in the available databases list.

note: we are already able to connect php to sql server using freetds, but just can't figure out how to do this on Drupal 7.

marquito
  • 885
  • 11
  • 29

2 Answers2

0

You can't use sqlsrv module on Linux because it requires PDO_SQLSRV driver that works only on Windows (see this comment)

To use FreeTDS you will need to write a Drupal Database Driver by yourself (similar with sqlsrv). Or don't use the database abstraction layer at all and do the call by yourself inside your module (if you only need MS SQL for parts of you project.

The good news (I hope) is that you can install dblib driver (in Ubuntu: sudo apt-get install php5-mssql) and use the sandbox project. A little info regarding this sandbox projects you can find in author's comment here. How to use it in you settings.php file can be seen here.

dblib database support in Drupal is still experimental, so test it before using it.

Luxian
  • 676
  • 7
  • 14
0

No you can't, but you can use drupal odbc driver which works the same way but connect through odbc (https://www.drupal.org/sandbox/pstewart/2010758), all you have to do is to install it (including its server requirement) and change your configuration to something like this (tested on Drupal 7 on Ubuntu Server) :

'external' =>
    array (
    'default' =>
    array (
        'odbc_driver' => 'FreeTDS',
        'database' => '',
        'username' => '',
        'password' => '',
        'host' => '',
        'port' => '1433',
        'driver' => 'odbc',
        'prefix' => ''
    ),
),
Sina Salek
  • 323
  • 2
  • 14