Magento error “The PDO extension is required for this adapter but the extension is not loaded”

One of our client was getting error on Magento,Error was like below:

The PDO extension is required for this adapter but the extension is not loaded”;i:1;s:1536:”#0 /home/fnmvhnvj/public_html/lib/Zend/Db/Adapter/Abstract.php(247): Zend_Db_Adapter_Pdo_Abstract->setFetchMode(2)
#1 /home/user/public_html/app/code/core/Mage/Core/Model/Resource.php(165): Zend_Db_Adapter_Abstract->__construct(Array)
#2 /home/user/public_html/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection(‘pdo_mysql’, Object(Mage_Core_Model_Config_Element))

To resolve this error make a custom php.ini file into your Magento root directory and add the following lines:

extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so

Now reload your website and you will no more see that error.