TurnKey Linux Virtual Appliance Library

Installing PHP extensions pdo and pdo_mysql on LAMP appliance

jgab's picture

Hi, I would like to install PIWIK (Piwik is an open source alternative to Google Analytics) on the LAMP appliance.

One of the Piwik requirements is to have installed the PHP extensions pdo and pdo_mysql.

How can I install them on the LAMP appliance?

Thanks for your help!

Liraz Siri's picture

What I found Googling for "Ubuntu pdo pdo_mysql"

Remember that TurnKey Linux is Ubuntu under the hood so nearly all of the information you'll find online that applies to Ubuntu and Debian will also apply to TurnKey Linux.

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

Alon Swartz's picture

You might also need...

You might also need to add the following to /etc/php5/apache2/php.ini
And ofcourse, don't forget to restart apache2.
Guest's picture

Does not work in Ubuntu 10.04

The PDO drivers are now part of the core instead of PECL.

How can PDO and PDO_MYSQL be configured?

Jeremy Davis's picture

I'm not sure

But from a quick google it seems they are a default part of php (since v5.1 - TKL v11.x has v5.3). I would assume that it is enabled by default, but if not then I imagine you just need to add it to the php.ini file (see Alon's post above).

Guest's picture

helped me

Thanks it saved me

Guest's picture



Guest's picture

OMG Thanks!

OMG, thanks! You just saved my life!

Guest's picture

Im getting error on Ubuntu 12.04

When I tried as mentioned above im getting the following error

Both these two commands were giving error


/tmp/pear/temp/PDO/pdo_dbh.c: In function 'pdo_hash_methods':
/tmp/pear/temp/PDO/pdo_dbh.c:1122:24: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
/tmp/pear/temp/PDO/pdo_dbh.c:1126:20: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
make: *** [pdo_dbh.lo] Error 1
ERROR: `make' failed


Pls Help Im very new on LINUX


Jeremy Davis's picture

Probably best to ask on Ubuntu forums

Turnkey is now based on Debian and whilst they are close, they're not the same... You may get lucky, but I doubt you'll get an answer here... Sorry

Guest's picture

not loging codigniter project

load the loging page, but cant loging in codeigniter in linux mint

Jeremy Davis's picture

So you're running the TurnKey CodeIgniter appliance in VBox?

Or similar? Probably best to start a new thread as it's not really relevant here...

Also please provide a few more details about your setup, e.g. clarify that you are running in VirtualBox, if not what? What image (e.g. ISO or VMDK)?

If you didn't mean the TurnKey Linux CodeIgniter appliance then you're in the wrong place... This is the TurnKey Linux forums...

Guest's picture

Help me out

Need to install pdo_mysql driver for php 5.4.30 version

Guest's picture

PDO fixed by a single package

Im on a new Ubuntu 12 server install and getting same problem.

I've solved it by: apt-get install php-mysql

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)