1

I am using Symfony 3.0, PHP 5.6.17 on Windows 7, with IIS 7.5 and a SQL Server Database (MSSQL).

Like a lot of people, I'm currently having the pdo_exception:

  [Doctrine\DBAL\Exception\DriverException]
  An exception occured in driver: could not find driver



  [Doctrine\DBAL\Driver\PDOException]
  could not find driver



  [PDOException]
  could not find driver

However, I don't know how to trace the error. Here's what I have:

PHP.ini The two dll are properly named and located in the ext folder

;extension=php_sqlsrv_56_nts.dll
extension=php_pdo_sqlsrv_56_nts.dll

I tried activating and deactivating php_sqlsrv_56_nts.dll without any difference.

It looks, from phpinfo that the files are loaded:

enter image description here

Also, doing php -i I can see that it is enabled in command line also:

enter image description here

Finally, here's what I have in Symfony's config file:

doctrine:
    dbal:
        driver:   pdo_sqlsrv
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"

I really don't know what to look into anymore.

Etienne Noël
  • 5,988
  • 6
  • 48
  • 75

1 Answers1

3

in this code you notice :

;extension=php_sqlsrv_56_nts.dll
extension=php_pdo_sqlsrv_56_nts.dll

You must decomment first line :

extension=php_sqlsrv_56_nts.dll
extension=php_pdo_sqlsrv_56_nts.dll

Also :

  • restart IIS
  • app/console doctrine:cache:clear-metadata
  • app/console doctrine:cache:clear-query
  • app/console doctrine:cache:clear-result
  • app/console cache:clear

Perhaps you can also read this : Topic StackOverflow for Doctrine MSSQL

Community
  • 1
  • 1
miltone
  • 4,416
  • 11
  • 42
  • 76