Dealing with legacy stuffs #1 How To Install MsSQL Extension To Docker For PHP5

I would like to share my working Dockerfile that i prepared after too much research in internet…

FROM php:5.6.36-fpm
RUN apt-get update ;\
apt-get install -y --no-install-recommends \
freetds-dev freetds-bin freetds-common libdbd-freetds libsybdb5 libqt4-sql-tds libqt5sql5-tds ;\
ln -s /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/libsybdb.so ;\
ln -s /usr/lib/x86_64-linux-gnu/libsybdb.a /usr/lib/libsybdb.a ;\
docker-php-ext-install mssql ;\
docker-php-ext-configure mssql

You can validate your installation within the container like this:

$ php -m|grep mssql

And.. result should be like the following:

mssql

That’s it!

Like what you read? Give İbrahim Gündüz a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.