wodby / php

Generic PHP docker container images
MIT License
155 stars 103 forks source link

Add sqlsrv & pdo_sqlsrv extension for connecting to MSSQL Database #48

Closed gertvdb closed 6 years ago

gertvdb commented 6 years ago

Hi,

I was wondering if it would be possible to add sqlsrv & pdo_sqlsrv extension to the container so it will work out of the box to connect to MSSQL Databases.

I've been trying to set this up myself but no success :) Or maybe someone with more experience could point me in the right direction.

I though I could do this :

FROM wodby/php:7.2-4.9.0

USER root

RUN pecl install sqlsrv \
    && docker-php-ext-enable sqlsrv

RUN pecl install pdo_sqlsrv \
    && docker-php-ext-enable pdo_sqlsrv

RUN echo "extension= pdo_sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`\
RUN echo "extension= sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` \
csandanov commented 6 years ago

odbc driver isn't compatible with alpine https://github.com/Microsoft/msphpsql/issues/300

csandanov commented 4 years ago

Added via https://github.com/wodby/php/pull/119