The PDO extension is required for this adapter but the extension is not loaded in Magento Error



Today I have moved one website from our testing server to the client server and getting such kind of the error that The PDO extension is required for this adapter but the extension is not loaded. I was thinking that there must be pdo.so php extension which is not installed on the server. After recogniging the problem, I was looking for the php.ini file to check the extension but due to the shared hosting they did not provide me the ini file.

Here in this post I am trying to describe how to solve the such kind of the problem it is very easy and you can solve the problem by using the steps given below:

If you want to know more regarding the PDO look at http://php.net/manual/en/ref.pdo-mysql.php

If you have access of the php.ini file then check

;extension=pdo_mysql.so

Just you need to uncomment the line to activate so it looks like as

extension=pdo_mysql.so

Save the file and restart the server.

If you have no access of the php.ini file, follow the following steps

Step 1. Please check your Magento installation directory there must me a file named as php.ini.sample.
Step 2. Now rename the file from php.ini.sample to php.ini
Step 3. Put the below code into it

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

Step 4. Now refresh your browser cache and the problem has been solved.

Thanks for the reading and Enjoy the Magento coding.