do you have a tutorial to install the mssql library for php 7.1?

execute these instructions, for php 7.1 on Ubuntu 18.04?

RUN sudo apt-get -y install curl
RUN sudo su
RUN curl -s | apt-key add -
RUN bash -c "curl -s > /etc/apt/sources.list.d/mssql-release.list"
RUN exit
RUN sudo apt-get update && \
sudo ACCEPT_EULA=Y apt-get -y install msodbcsql17 && \
sudo ACCEPT_EULA=Y apt-get -y install mssql-tools && \
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile && \
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc && \
bash -c "source ~/.bashrc" && \
sudo apt-get -y install unixodbc-dev

RUN sudo apt-get -y install gcc g++ make autoconf libc-dev pkg-config && \
sudo apt-get -y install php7.1-dev && \
sudo apt-get -y install php-pear && \
pecl channel-update && \
sudo pecl install sqlsrv && \
sudo pecl install pdo_sqlsrv && \
sudo su && \
bash -c "echo > /etc/php/7.1/apache2/conf.d/20-sqlsrv.ini" && \
bash -c "echo > /etc/php/7.1/apache2/conf.d/30-pdo_sqlsrv.ini" && \

#bash -c "echo > /etc/php/7.1/apache2/conf.d/20-sqlsrv.ini" && \
#bash -c "echo > /etc/php/7.1/apache2/conf.d/30-pdo_sqlsrv.ini" && \

but it doesn’t work in digital ocean, there is something special with the Ubuntu iso (Digital ocean). ?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


This looks more or less correct. Are you getting any errors after the installation?

I would also suggest checking out the official instructions from the Microsoft documentation at:

Regards, Bobby