2

I would like to configure connection to sqlserver from my symfony config file.

PHP connection work fine

$mssqldriver == '{ODBC Driver 17 for SQL Server}';
PDO("odbc:Driver=$mssqldriver;Server=Myserver,Myport;Database=Mydatabese;", $username, $password)

Symfony config.yml(doesn't work!)

MSSQL:

        driver:    pdo_sqlsrv
        host:     '%database_host3%'
        port:     '%database_port3%'
        dbname:   '%database_name3%'
        user:     '%database_user3%'
        password: '%database_password3%'
        charset:  UTF8
BENARD Patrick
  • 30,363
  • 16
  • 99
  • 105
HaTeM
  • 21
  • 2
  • The PDO_SQLSRV extension is only compatible with PHP running on Windows. For Linux, see ODBC and ยป Microsoft's SQL Server ODBC Driver for Linux.source(http://php.net/manual/en/ref.pdo-sqlsrv.php) โ€“ HaTeM Jul 18 '18 at 12:17
  • It's an outside link, but my first search on google was this, https://dunglas.fr/2014/01/connection-to-a-ms-sql-server-from-symfony-doctrine-on-mac-or-linux/ Do you think it could help you ? โ€“ BENARD Patrick Jul 18 '18 at 12:22
  • @pbenard , (sorry for my english), I think that this solution is not adapted form linux server. i had to modify vendor to make it work! concerned file Realestate\MssqlBundle\Driver\PDODblib โ€“ HaTeM Jul 18 '18 at 13:52

0 Answers0