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.
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 ;-)
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
I installed PHP 7.2 with some additional packages like "php72-php-pdo", "php-pdo_mysql" and removed those lines from "php.ini".