1

Is there any way to configure and connect to MSSQL database using Symfony 4?

I tried to configure Doctrine, but I get the error that I cannot debug. I'd be grateful for any clues.

  1. I've put the line below in .env file:

DATABASE_URL=sqlsrv://myname:mypassword@symfonytest.database.windows.net/AzureDB?port=1433

Then I run the command in CMD to ping the database and I get the error (I've just hidden the username and password here): enter image description here

  1. I get the same result when I put the configuration in doctrine.yaml: enter image description here

  2. I've added the proper drivers into WAMP.

Extensions in php.ini: extension=php_pdo_sqlsrv_71_ts.dll extension=php_sqlsrv_71_ts.dll

WAMP 3.1.0 PHP version: 7.1.9 APACHE 2.4.27

But generally I cannot run my app through WAMP, because something wrong happens with links, so...

  1. I run it by running the command in CMD:

php bin/console server:run

And all in all - I get the error like I described.

Sorry for pictures - I was fighting with the SO to put the code here, but it always "appeared as not properly formatted".

Publius
  • 33
  • 1
  • 5

1 Answers1

0

Please use this Azure Distribution Bundle to connect Symphony to Azure services.

This the official Microsoft documentation to connect to Azure SQL Database from PHP.

Alberto Morillo
  • 13,893
  • 2
  • 24
  • 30