Connecting Doctrine 2 to MSSQL For SYMFONY 2 On Linux

前端 未结 1 1117
逝去的感伤
逝去的感伤 2021-02-03 11:29

I am trying to use Doctrine 2 (for Symfony 2) to connect to MSSQLServer from a linux machine.

I have installed pdo_dblib (PDO Driver for FreeTDS/Sybase DB-lib) and am ab

相关标签:
1条回答
  • 2021-02-03 11:48

    Under linux (at least Debian based distros), php needs the package php5-sybase that brings support for Sybase and MSSql.

    If you are using a debian based distribution you will want to do

    $ sudo apt-get install php5-sybase
    $ sudo service apache2 restart
    

    And

    php -r "phpinfo();" | grep "PDO drivers"
    

    should give you

    PDO drivers: dblib, mysql, sqlite, ...

    dblib is actually the one we need

    Now to be able to use this driver with Doctrine, this post: Doctrine 2 - How to add custom DBAL driver? helped me to find the answer.

    The OP suggests to use this bundle on git that makes things work together.

    0 讨论(0)
提交回复
热议问题