Not able to connect mssql server - "driver not found error"

I am using Ubuntu 16.04

php version : php 7.2

When tried to connect MySQL server with the yii2 application I got an error ,below pasted

Database Exception – yii\db\Exception
could not find driver

Caused by: PDOException
could not find the driver
in /home/loremine/websites/rentandservices.local/vendor/yiisoft/yii2/db/Connection.php at line 719

Here I wish to connect both MySQL and SQL servers at the same time for the same application

For a set of functions,I need to connect SQL server.More specifically for two functions.Except that the entire website will connect to the MySQL database. Mysql works perfectly,but mssql server returns error
Connection string pasted here.Here I used a remote connection .Also tried with local DB.Returns the same error
‘db’ => [
‘class’ => ‘yii\db\Connection’,
‘dsn’ => ‘mysql:host=localhost;dbname=rns_staging_6’,
‘username’ => ‘root’,
‘password’ => ‘quickstart’,
‘charset’ => ‘utf8’,
‘queryCacheDuration’=>1

    ],
'db1' => [
  'class' => 'yii\db\Connection',
  'driverName' => 'sqlsrv',
  'dsn' => 'sqlsrv:Server=50.201.227.146;Database=Y21',
  'username' => 'lm21user',
  'password' => 'Y2!ldn21amz1',

 'charset' => 'utf8',
 'queryCacheDuration'=>1

],

Please help

here the sample of db config

<?php

return [

    'class' => 'yii\db\Connection',

    'dsn' => 'mysql:host=localhost;dbname=your_db',

    'username' => 'root',

    'password' => 'your_password',

    'charset' => 'utf8',

];

Thank you for the reply.

Actually, I want to connect with the mssql server and not with MySQL.MySQL config works perfectly. but MSSQL server is not able to connect. That is my problem. I am using PHP 7.2 with the latest version of the MSSQL server. Kindly check and update me.The error pasted here

maybe you can read this

Hi,
Thank you for the reply.let me check and update
Thanks & Regards
Maya A