7

I have a new CentOS 6 server running PHP 5.3.2. The output of php -v shows

Unable to load dynamic library '/usr/lib64/php/modules/pdo_mysql.so - 
/usr/lib64/php/modules/pdo_mysql.so cannot open shared object file

I modified /etc/php.ini to include extension=pdo.so and extension=pdo_mysql.so and restarted httpd. I did install PDO and phpinfo.php shows pdo_sqllite installed?? How do I install pdo_mysql and rectify above warning message?

SidC
  • 369
  • 3
  • 9
  • 23

2 Answers2

14

you have to install the library first.

yum install php-mysql 
quanta
  • 50,327
  • 19
  • 152
  • 213
heiko
  • 156
  • 1
  • 2
-2

My server Centos 6.3, PHP 5.4.8, Nginx.


I try to reindex my Magento website:

php -f indexer.php reindexall

And get error:

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

Then I run:

pecl install pdo

yum install php-mysql

then, restart server

service nginx restart

Try to reindex Magento:

php -f indexer.php reindexall

It works :)

  • This is illegible. I can't tell how to format it properly, else I'd edit it. Please use code blocks for configuration files and console input/output so that there's a visual organization to the text in the answer. See [Formatting Help](http://serverfault.com/help/formatting) – austinian Aug 21 '15 at 05:29
  • Hi, I'm new in here and just wanna try to help the other has the same problem with Re-Index Magento on Centos 6.3, PHP 5.4.8, Nginx. So, pls do not vote down if you do not have the same problem and do not understand. Thanks. – Nguyen Hoai Duc Aug 23 '15 at 02:44
  • This is a similar error to a different question. The question at hand is how to resolve the failure to load the pdo_mysql dll when `extension=pdo_mysql.so` is included in the php.ini file, not when you get the error 'The PDO extension is required for this adapter but the extension is not loaded'. Please keep answers on topic, and if you have the answer to a different question that hasn't been asked, [please ask and then answer another question](http://serverfault.com/help/self-answer). You can feel free to link to this question as a related question, but it is not the same question. – austinian Aug 23 '15 at 03:10