Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8225533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:26:57+00:00 2026-06-07T15:26:57+00:00

I am trying to use Doctrine 2 (for Symfony 2) to connect to MSSQLServer

  • 0

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 able to connect to the db server via tsql on the command line and from the php cli also. Thus I know this is working.

In my Symfony/app/config/parameters.ini file I had specified database_driver=”pdo_sqlsrv” as the database driver (as I read that this would be handled by db_lib) but when trying to run a create database command (using the command php app/console doctrine:database:create) I am getting the error:

Could not create database for connection named could not find driver

I then changed the driver to database_driver="pdo_dblib" and I am now getting the error:

[Doctrine\DBAL\DBALException]
The given ‘driver’ pdo_dblib is unknown, Doctrine currently supports
only the following drivers: pdo_mysql, pdo_sqlite, pdo_pgsql, pdo_oci,
oci8, ibm_db2, pdo_ibm, pdo_sqlsrv

So it seems that to connect to MSSQL my only option is pdo_sqlsrv, so I went to install this. However, I have just discovered here, that

The PDO_SQLSRV extension is only compatible with PHP running on Windows.

Thus the driver supported by doctrine and those available to use on linux seem to be mutually exlusive. From searching I haven’t found any instances of this issue being solved thus far (One guy marked the issue as solved, but when I read the thread he had simply moved his dev env to a windows box… not exactly what I had in mind!).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:26:58+00:00Added an answer on June 7, 2026 at 3:26 pm

    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
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I'm trying to use Doctrine to retrieve some data. I have some basic
I'm trying to use Doctrine with a poorly designed PostgreSQL database. Some tables have
I am trying to use Doctrine 2 Migrations in my Symfony project. for that,
I'm trying to use auto-generated forms in symfony, but I have troubles finding good
I am trying use gem tire to search in my application. I have tables
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
Hi I'm trying use a datepicker on a field I have. I'm trying to
I have been looking at nestedSet behaviour in symfony using doctrine, to display a
I am trying to use do the most simple update query but Doctrine issues
I am new to symfony 2. I am trying to use custom repository in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.