Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I tried to install mysql PDO driver with this command:

$ sudo pecl install pdo_mysql

but I got the following error:

WARNING: "pecl/PDO_MYSQL" is deprecated in favor of "channel://http://svn.php.net/viewvc/php/php-src/trunk/ext/pdo_mysql//ext/pdo_mysql"
WARNING: "pecl/PDO" is deprecated in favor of "channel://http://svn.php.net/viewvc/php/php-src/trunk/ext/pdo//ext/PDO"
downloading PDO_MYSQL-1.0.2.tgz ...
Starting to download PDO_MYSQL-1.0.2.tgz (14,778 bytes)
.....done: 14,778 bytes
downloading PDO-1.0.3.tgz ...
Starting to download PDO-1.0.3.tgz (52,613 bytes)
...done: 52,613 bytes
12 source files, building
running: phpize
sh: phpize: not found
ERROR: `phpize' failed
7 source files, building
running: phpize
sh: phpize: not found
ERROR: `phpize' failed

Does anybody know how to install PDO drivers in Ubuntu 10.04?

Thanks

share|improve this question

migrated from stackoverflow.com Jun 29 '11 at 17:28

This question came from our site for professional and enthusiast programmers.

4 Answers 4

up vote 7 down vote accepted

At least in ubuntu 11.04 as well as kubuntu 11.04 mysql, mysqli and pdo_mysql are included in the php5-mysql package.

I assume this is also the case for 10.04

share|improve this answer
2  
Thanks the answer was that: sudo apt-get install php5-mysql –  j2gl Jun 29 '11 at 17:41
1  
Glad you wrote this: sudo apt-get install php5-mysql otherwise I'd still be looking for the right command (this helped me to find out about gd support: sudo apt-get install php5-gd) –  Olivier Pons Aug 25 '12 at 4:03

PDO classes for PHP are all available in Apitude. use sudo aptitude then hit / and type in PDO if you want to use the GUI (I'm lazy, I almost always do)

share|improve this answer
    
Thanks for your help. –  j2gl Jun 29 '11 at 17:42

You don't want to install PDO or PDO_MySQL through pecl. PDO was moved into PHP core in 5.1.0 and the extensions in the PECL repository are quite old. You can find the pdo_mysql extension in the php5-mysql (apt-get install php5-mysql) package.

If you do need to install any extensions using pecl, the error you are seeing indicates that phpize is not installed. This can be found in the php5-dev package.

share|improve this answer

If you don't get it only with this

apt-get install php-mysql

you can try this

apt-get install php-pear php5-dev libmysqlclient15-dev
pecl install pdo
pecl install pdo_mysql

I've found googling it was the only that works fine for me

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.