access external ms sqlserver db config

Permalink
Hello,

I´m having troubles to connect to an external ms sqlserver from my c5. I've tried PDOSqlsrv and SQLSrv and the first one says it can't find the class and the second says: Call to undefined function Doctrine\DBAL\Driver\SQLSrv\sqlsrv_configure()

What do you suggest? Thank you

My code is:
<?php
return [
    'default-connection' => 'concrete',
    'drivers' => array(
        // 'pdo_sqlsrv' => 'Doctrine\DBAL\Driver\PDOSqlsrv\Driver'
        'pdo_sqlsrv' => 'Doctrine\DBAL\Driver\SQLSrv\Driver'
    ),
    'connections' => [
        'concrete' => [
            'driver' => 'c5_pdo_mysql',
            'server' => 'localhost',
            'database' => 'mysqldb',
            'username' => 'root',
            'password' => 'mysqlpassw',
            'charset' => 'utf8',

titanve
 
titanve replied on at Permalink Reply
titanve
Hello all!,

I solved this problem by doing this:
- Installing SQL Server driver, from here:https://github.com/Microsoft/msphpsql/#install-linux...
- database.php is like this:
<?php
return [
    'default-connection' => 'concrete',
    'drivers' => array(
      // 'pdo_sqlsrv' => 'Doctrine\DBAL\Driver\PDOSqlsrv\Driver'
      'pdo_sqlsrv' => 'Doctrine\DBAL\Driver\SQLSrv\Driver'
    ),
    'connections' => [
        'concrete' => [
            'driver' => 'c5_pdo_mysql',
            'server' => 'localhost',
            'database' => 'maindb',
            'username' => 'root',
            'password' => 'password1',
            'charset' => 'utf8',


Have a great day everyone.