Question

Please help how to install and configuring sqlsrv extension on Ubuntu 16 with xampp

Could someone kindly write step by step tutorial to install and configuring sqlsrv extension on my xampp ?

Any help so much appreciated…

Thank you

Subscribe
Share

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

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.

Hi @andrenoto,

I take it you mean a PHP SQLSRV extension, am I right?

I’ve found a couple of tutorials online outlining the following process:

To install the PHP SQLSRV extension, SSH in to your server as root and run the following commands to install prerequisites:

On Ubuntu 16.04

curl -s https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo bash -c "curl -s https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list"
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get -y install msodbcsql17 mssql-tools
sudo apt-get -y install unixodbc-dev

Next, run the following commands to install the extension:

sudo apt-get -y install gcc g++ make autoconf libc-dev pkg-config
sudo pecl7.X-sp install sqlsrv
sudo pecl7.X-sp install pdo_sqlsrv

Once installed, create configuration files for the extension and restart PHP by running the following commands as root:

sudo bash -c "echo extension=sqlsrv.so > /etc/php7.X-sp/conf.d/sqlsrv.ini"
sudo bash -c "echo extension=pdo_sqlsrv.so > /etc/php7.X-sp/conf.d/pdo_sqlsrv.ini"
sudo service php7.X-fpm-sp restart

Please note that this is based on one of the tutorials I found in Google, make sure to create a backup prior to starting the process.