Skip to content

Instantly share code, notes, and snippets.

@manuelgeek
Created January 8, 2018 06:48
Show Gist options
  • Save manuelgeek/11903ddd23e3ed01b7bc3c855aef25f2 to your computer and use it in GitHub Desktop.
Save manuelgeek/11903ddd23e3ed01b7bc3c855aef25f2 to your computer and use it in GitHub Desktop.
Php 7.0 and MSSQL connection on Ubuntu
sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql mssql-tools unixodbc-dev
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
echo "extension=sqlsrv" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
echo "extension=pdo_sqlsrv" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment