6

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

j2gl
  • 163
  • 1
  • 1
  • 6

4 Answers4

9

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

fyr
  • 216
  • 1
  • 2
  • 2
    Thanks the answer was that: sudo apt-get install php5-mysql – j2gl Jun 29 '11 at 17:41
  • 2
    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 04:03
3

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.

JamesArmes
  • 205
  • 3
  • 9
2

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)

cwallenpoole
  • 325
  • 2
  • 13
1

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

ackuser
  • 111
  • 2