Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Phalcon 3 and mssql server

Hi, i would like upgrade my phalcon to 3.0 and php to 7.0, but in my app i need connect to MSSQL server :( In 2.0.x version i use lib but after upgrade to 3.0 i have error

Declaration of Phalcon\Db\Adapter\Pdo\Sqlsrv::connect($descriptor = NULL) should be compatible with Phalcon\Db\Adapter\Pdo::connect(array $descriptor = NULL)

in changelog i don't seen any changes for PDO so I'm a bit confused. I wroted to "ToNict" but i don't know when he/she anserw. Have anyone idea what was changed or what i schould do to run this stuff?


The class was changed as you see. You just need to add array before $descriptor in Phalcon\Db\Adapter\Pdo\Sqlsrv::connect. Perhaps do even more things. Phalcon don't really like mssql.

edited Aug '16

you can simply add array argument type hint at line 38 in Phalcon\Db\Adapter\Pdo\Sqlsrv.php like this

public function connect(array $descriptor = null)

it will be fine because we always pass array so type hinting won't matter


Hi, thanks for anserw. That work :) Another problem is no support for sqlsrv in php7 ;)

This driver is official and contributors are from Microsoft.

Hi, thanks for anserw. That work :) Another problem is no support for sqlsrv in php7 ;)


Yeap, but this is for Windows, but i have Debian...

well..they have supported ubuntu15 and 16 not sure if that'll work with debian or not....


Hi I checked few things and I solved it.

all i described:

Thanks for helping guys :)

On Debian/GNU, I'm using and plain PHP PDO / dblib:

You just build ORM-like wrapper around it and voila.