0

I am trying to move a legacy application (CakePHP 2.5.5) running on PHP 5.6 to a Docker container but I can't get the PDO driver for Microsoft SQL Server to work.

I have been searching around for hours but all install instructions seem to say that SQLSRV PDO driver is only supported by PHP 7.

I cannot run CakePHP 2.5.5 on PHP 7 so I have to make it work with PHP 5.6. (Unless someone knows how to make it work with PHP 7?)

I am using the official Docker PHP image for PHP 5.6 (php:5.6-apache) which uses Debian 9 (stretch)

I tried

pecl install sqlsrv

But I get pecl/sqlsrv requires PHP (version >= 7.1.0), installed version is 5.6.40

Then I tried

pecl install sqlsrv-3.0.1

But it fails.

I tried this https://gist.github.com/joecampo/acd1e5881aee08bd8959 but it didn't change anything.

Bottom line: I ask for help to make my CakePHP 2.5.5 work with the SQLSRV PDO driver in a docker container.

  • You missed the deadline to upgrade to PHP 7 and a CakePHP version that works with it. PHP 5.6 is out of support. That is why you are having this problem. And actually upgrading is the solution. – Michael Hampton May 19 at 17:40
  • Both PHP/Microsoft tries to get rid of legacy items, so if you want to stick to the past, you need to dig back the ancient versions from archives. If you don't have an archive yourself, then you have no option but to upgrade. – Lex Li May 19 at 17:52
  • Thanks. I understand now. I ended up migrating to a newer CakePHP version and luckily this went easier than expected... – Morten Twellmann May 30 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.