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

December 29, 2018 258 views
PHP Ubuntu 18.04

execute these instructions, for php 7.1 on Ubuntu 18.04?

# INSTALL MSSQL 17
RUN sudo apt-get -y install curl
RUN sudo su
RUN curl -s https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN bash -c "curl -s https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /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

######## INSTALL EXTENSION SQLSRV & PDO_SQLSRV ##########
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 pecl.php.net && \
sudo pecl install sqlsrv && \
sudo pecl install pdo_sqlsrv && \
sudo su && \
bash -c "echo extension=sqlsrv.so > /etc/php/7.1/apache2/conf.d/20-sqlsrv.ini" && \
bash -c "echo extension=pdo_sqlsrv.so > /etc/php/7.1/apache2/conf.d/30-pdo_sqlsrv.ini" && \
exit

#bash -c "echo extension=sqlsrv.so > /etc/php/7.1/apache2/conf.d/20-sqlsrv.ini" && \
#bash -c "echo extension=pdo_sqlsrv.so > /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). ?

Be the first one to answer this question.