CakePHP 5 and MS SQL Server

Hi to all.

I need step by step guide to configure correctly CakePHP 5.x to use MS-SQL Server.
I have to create a web-app using this DB; I have no choice of using other DB engine.

I have downloaded extensions and correctly installed on PHP on XAMPP.

I have tryed to configure connection on app.php and on app_local.php but don’t works.

Error on CakePHP welcome page is:

  • CakePHP is NOT able to connect to the database.
    Connection to Sqlserver could not be established: SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]Provider TCP: No connection could be made because the target machine actively refused it.

Someone can help me?

Thanks…

This indicates that there is a problem with how your MS-SQL server is set up. It’s not allowing a connection to be made to it. That’s not a CakePHP-specific problem, it’s best solved by looking at MS-SQL resources.

As you can see in the most recent Github Actions CI run the tests for CakePHP are running fine with MSSQL/SQLServer

So this is 100% a configuration error on your side

That’s true! I’ve resolved changing setting on my MS-SQL Server and also I have to ovverride the configuration on app_local.php on cake/config folder…

That’s not indicate in guides…

Thank’s a lot!!!

Feel free to create a PR for the docs if you think they can be improved