Closed joelataylor closed 2 months ago
@joelataylor I just had to do that and it seems to be quite the hassle.
This is an excerpt from my Dockerfile:
RUN sh -c "curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -" \
&& apt-get update \
&& sh -c "curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list" \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install -y \
msodbcsql18 \
mssql-tools18 \
unixodbc-dev \
php-pear \
php-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN pecl config-set php_ini /etc/php/8.3/fpm/php.ini
RUN pecl install sqlsrv
RUN pecl install pdo_sqlsrv
RUN printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/8.3/mods-available/sqlsrv.ini
RUN printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/8.3/mods-available/pdo_sqlsrv.ini
RUN phpenmod -v 8.3 sqlsrv pdo_sqlsrv
First your installing the ODBC drivers from microsoft then your are installing php-pear so you can use pecl. This is done for php-fpm so you might need to adjust it to your needs.
This will probably get the job done but i would rather avoid installing php-pear in the future. So an easier way would be much appreciated.
Thank you @mistraloz (sorry, I didn't get an alert on this message). Good to go now. Much appreciated!
I did a search for sqlsrv and couldn't find anything specific around installing this extension. Do you have any tips for installing?
Didn't work, but I didn't really expect it to as it's not listed on the available extensions. Help? Thank you!