How to connect CakePHP on MacOS to SQLserver on Linux?

#1

Hi,

I’m running CakePHP on MacOS. For a work project I need to build an app connecting to SQLserver. I have an SQLserver running on linux in a docker container, and I can connect to that with CLI (using php or sqlcmd) and with a php file via my web browser.

After a lot of work I finally installed drivers that prevented bake from returning an error that the driver could not be found.

However, if I try to bake an app I get the error: 2019-04-15 11:34:16 Error: [Cake\Database\Exception\MissingExtensionException] Database driver Cake\Database\Driver\Sqlserver cannot be used due to a missing PHP extension or unmet dependency in app/vendor/cakephp/cakephp/src/Database/Connection.php on line 177.

Before I go any further; is this even possible?

Thanks!

0 Likes

#2

You need to have the pdo_sqlsrv extension installed on MacOS. Looks like these instructions can help.

0 Likes