Created
February 14, 2019 01:24
-
-
Save jgaydos/c03fc893aabd7a1911aa520448257cd4 to your computer and use it in GitHub Desktop.
Ubuntu 16.04 + PHP7.2 + SQLSRV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#ubuntu 16.04 | |
#php7.2 | |
# install php ppa | |
add-apt-repository ppa:ondrej/php | |
apt update -y | |
# install php w/o apache | |
apt -y install php7.2-cli php7.2-mbstring php-pear php7.2-dev | |
#3 install sqlcmd | |
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | |
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/mssql-tools.list | |
apt update | |
ACCEPT_EULA=Y apt -y install mssql-tools | |
apt -y install unixodbc-dev | |
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile | |
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc | |
source ~/.bashrc | |
# install sqlsrv driver | |
pecl install sqlsrv pdo_sqlsrv | |
echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini | |
echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment