Connecting Doctrine 2 to MSSQL For SYMFONY 2 On Linux Connecting Doctrine 2 to MSSQL For SYMFONY 2 On Linux sql-server sql-server

Connecting Doctrine 2 to MSSQL For SYMFONY 2 On Linux


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.