Reputation: 1321
I want to load pdo_mysql extension to php inorder to install Megento in my VPS (runs CentOS). Then I searched the PHP.ini file for something like "extension=pdo.so ". But I was unable to find such a line in my ini file. Then I tried to install pdo_mysql using "pecl install" . But the installation exits by displaying this error ,
checking for PDO includes... checking for PDO includes...
configure: error: Cannot find php_pdo_driver.h.
ERROR: `/root/tmp/pear/PDO_MYSQL/configure' failed
My phpinfo . Please help me to solve this problem.
Upvotes: 2
Views: 11941
Reputation: 17481
Current PHP comes with PDO extension in its core, but you still need to add support for each database engine you need to connect to.
I had this problem with symfony2 complaning about the lack of pdo_pgsql driver. I looked everywhere on the web and basically concluded that I had to do (in ubuntu)
sudo apt-get install libpq-dev
sudo pecl install pdo_pgsql
But that will fail, basically for the same reason as it failed you (in my case it said configure: error: Cannot find php_pdo_driver.h.
)
then, by accident, I found out that you need to install the packages as
sudo apt-get install php5-pgsql
sudo apt-get install php5-mysql
and that will add pdo_pgsql and pdo_mysql to your PDO driver.
In centOS, it should be
sudo yum install php-pgsql
sudo yum install php-mysql
Upvotes: 1
Reputation: 10469
You have to build PHP with PDO support.
http://pecl.php.net/package/PDO
"Do not use this, as PDO has been moved into core (the php source) so this pecl extension is dead."
Upvotes: 2