Connect Doctrine to a MS SQL Database

Just before i get started, i have been trying to figure this out and have clicked nearly every google link there is and i have read nearly all the other questions on this. but im stuck because the bundles that are being suggested for this are out of date. so please bare with me.

Okay so i am creating a website. it is a symfony2 application that is being hosted on Microsoft azure. What i want to do is be able to use doctrine of course to fetch and create users to and from the database.

Now from what i’ve been reading, to connect to this type of database, i have to use the driver called “PDO_dblib”.

I have installed this bundle as it seems to be the only one thats still active, don’t quote me on that.

https://github.com/realestateconz/MssqlBundle

Now i installed this in my vendor folder, is this the correct place to store it? Like so:

Project/
    app/
    src/
    vendor/
       realestate/

Of course i added the bundle to the AppKernel like so:

 new Realestate\MssqlBundle\RealestateMssqlBundle();

and last but not least here is what i have in my config file:

 doctrine:
     dbal:
       default_connection:     default
       connections:
           default:
               driver_class:   Realestate\MssqlBundle\Driver\PDODblib\Driver
               host:           %database_host%
               dbname:         %database_prefix%%database_name%
               user:           %database_user%
               password:       %database_password%

so what im thinking im doing here is telling doctrine to use this driver? dont see what else it could be.

I have also declared my parameters.yml for the connection settings.

PS: I am doing my Dev on Linux Mint!

before i tried the steps of this bundle i also ran throught this websites steps: https://dunglas.fr/2014/01/connection-to-a-ms-sql-server-from-symfony-doctrine-on-mac-or-linux/

But again it was throwing errors, ill post the errors i get down below!
So for the record i have installed freetds and php5-sybase.

The errors that i am getting are such:

 [Symfony\Component\Debug\Exception\ContextErrorException]                                                               
 Warning: class_implements(): Class Realestate\MssqlBundle\Driver\PDODlib\Driver does not exist and could not be loaded

and also this when i try to do a:
php app/console doctrine:database:create

(I do have my entity set up)

but i get the following error from the command of create:

 [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]                                                 
 You have requested a non-existent parameter "database_prefix". Did you   mean one of these: "database_port", "database_user"?

I have been trying to get this working for the past few days and any help would be fantastic! Any more information needed feel free to ask of course!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s