apt-get install update

apt-get install software-properties-common apt-utils

add-apt-repository ppa:ondrej/php -y
apt-get update
apt-get install php7.2 php7.2-dev php7.2-xml -y –allow-unauthenticated

apt-get install gnupg gnupg2 gnupg1
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add –
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list

apt-get update
ACCEPT_EULA=Y apt-get install msodbcsql17
ACCEPT_EULA=Y apt-get install mssql-tools

echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”‘ » ~/.bash_profile
echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”‘ » ~/.bashrc
source ~/.bashrc

apt install -y unixodbc-utf16 unixodbc-dev-utf16 2> /dev/null
sudo apt-get install php-pear
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv

#had to modify the location

echo “” » $phpini
echo “# Extensions for Microsoft SQL Server Driver” » $phpini
echo “extension=sqlsrv.so” » $phpini
echo “extension=pdo_sqlsrv.so” » $phpini
echo “” » $phpini

#I didn’t had CLI?!

#echo “” » $phpini
#echo “# Extensions for Microsoft SQL Server Driver” » $phpini
#echo “extension=sqlsrv.so” » $phpini
#echo “extension=pdo_sqlsrv.so” » $phpini
#echo “” » $phpini

echo “Installing Microsoft ODBC Driver for SQL Server”

# Originally from: http://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/msodbcsql/
apt install -y libc6 libstdc++6 libkrb5-3 libcurl3 openssl debconf unixodbc unixodbc-dev

#doesn’t work: $basedir is not set, but also none of the (sub)directories exist on my setup
#sudo ACCEPT_EULA=Y dpkg -i $basedir/config/php-extensions/mssql/bin/debs/current/*.deb

# Create symlinks for tools
#had to change the source filenames to sqlcmd and bcp because with - suffix the files were not found
ln -sfn /opt/mssql-tools/bin/sqlcmd /usr/bin/sqlcmd
ln -sfn /opt/mssql-tools/bin/bcp /usr/bin/bcp

service php7.2-fpm restart




apt-get install -y locales     && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen     && locale-gen
<pre><code>apt-get update

apt-get install libssl1.0.0 libssl-dev

  Now lets fix the naming of the file by creating a link:

<pre><code>cd /lib/x86_64-linux-gnu

ln -s libssl.so.1.0.0 libssl.so.10 ln -s libcrypto.so.1.0.0 libcrypto.so.10

make sure that <span class="str">extension=pdo_sqlsrv.so</span> is loaded in 30-pdo_sqlsrv.ini instead of php.ini

debugging do ldd pdo_sqlsrv.so or any other .so files