NOTE : Only for Ubuntu >= 16.04 and PHP version >= 7.0
First follow the steps as described here
After completing all the steps and checking the MS-Sql Version follow steps below.
Check if you have g++ installed.
$ sudo apt-get install g++
After successful installation, go to step two
Then add the extension for the sqlsrv and pdo_sqlsrv in /etc/php/7.0/apache2/php.ini for apache do the same in /etc/php/7.0/cli/php.ini command line interface.
Then restart apache and see phpinfo for changes. Look for sqlsrv in PDO and sqlsrv section.
In terminal you can enter
$ php -m
to view all the loaded php modules in cli.
If everything is fine then the drivers have been installed.