cancel
Showing results for 
Search instead for 
Did you mean: 

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

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

Hello.

When I want to install "Magento 2.X" the I got below error:

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

I added below lines to "php.ini" too but problem exist:

extension=pdo.so
extension=pdo_mysql.so
extension=php_pdo.dll
extension=php_pdo_mssql.dll

How can I solve it?

 

Thank you.

11 REPLIES 11

Re: The PDO extension is required for this adapter but the extension is not loaded

Hi ,

Did you restarted the php server after changes in php.ini ?

Restart php server once.

You can also check server required php extension and the status using following script file.

https://community.magento.com/t5/Welcome-to-the-Magento-Community/Hello-Everyone-in-Magento-Communit...


I hope it will help you.

Re: The PDO extension is required for this adapter but the extension is not loaded

First of all, you cannot have both :

extension=pdo.so
extension=pdo_mysql.so

Which are for Linux, and :

extension=php_pdo.dll
extension=php_pdo_mssql.dll

Which are for windows : you've got to choose, depending on the system you are using.

 

After correcting that, restart Apache ; and things should get better.


If things don't get better, you should check the output of `phpinfo()` :

- At the beginning of `phpinfo()`'s output, it indicates which `php.ini` file is loaded ; make sure you modified the right one.
- Check, lower in the file, if there is a section about `pdo_mysql`
- If not, check Apache's error_log, just in case ;-)

Re: The PDO extension is required for this adapter but the extension is not loaded

I added two lines but problem exist.
I want to install the last version of Magento with PHP 7.2, I guess Magento is not OK with PHP 7.3.

Re: The PDO extension is required for this adapter but the extension is not loaded

PHP server? Is you mean Apache service?
When I downgraded PHP 7.3 to PHP 7.2 then "php.ini" became "php.ini.rpmsave". Can it make any problem?

Re: The PDO extension is required for this adapter but the extension is not loaded

Hi @jason_long,

Btw php 7.2 is recommended for Magento 2.3.

You can magento document for system requirements. Link below:

https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

Re: The PDO extension is required for this adapter but the extension is not loaded

What is you mean by "PHP server"?

Re: The PDO extension is required for this adapter but the extension is not loaded

I mean for php server is apache, mysql etc...

You can restart only apache..

Re: The PDO extension is required for this adapter but the extension is not loaded

I created a "phpinfo.php" file with below lines:

<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>

After it, I see that "php.ini" file is :

/etc/opt/remi/php72/php.ini

And I added two lines to this file and restart Apache but problem exist:

PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo.so' (tried: /opt/remi/php72/root/usr/lib64/php/modules/pdo.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo.so: cannot open shared object file: No such file or directory), /opt/remi/php72/root/usr/lib64/php/modules/pdo.so.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file: No such file or directory), /opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
The PDO extension is required for this adapter but the extension is not loaded

Re: The PDO extension is required for this adapter but the extension is not loaded

I installed PHP 7.2 with some additional packages like "php72-php-pdo", "php-pdo_mysql" and removed those lines from "php.ini".