Forum: 

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

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
Gonzalo Oviedo Lambert's picture

In my debian, fail to compile.

So, sudo apt-get install php-mysql or something like that and bingo, of course, after php5-dev i think.

Jeremy Davis's picture

So if you aren't root, then you'll need to prefix commands with 'sudo'.

Also FWIW this thread is quite old, so may not still be 100% relevant.

Alon Swartz's picture

You might also need to add the following to /etc/php5/apache2/php.ini
extension=pdo.so
extension=pdo_mysql.so
And ofcourse, don't forget to restart apache2.
Christoffer's picture

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

How can PDO and PDO_MYSQL be configured?

Jeremy Davis's picture

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).

amila's picture

Thanks it saved me

Sudhanshu's picture

Thanks

boss86741's picture

OMG, thanks! You just saved my life!

Arun's picture

When I tried as mentioned above im getting the following error

Both these two commands were giving error

extension=pdo.so
extension=pdo_mysql.so

/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

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

insaf's picture

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

Jeremy Davis's picture

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...

bhanu mishra's picture

Need to install pdo_mysql driver for php 5.4.30 version

erm3nda's picture

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

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

ahmed's picture

greate thank U

Isaac Rosario's picture

How do i installl the Microsoft SQL Server Extension to use it with PHP?

I'm on Linux Ubuntu

 

Post new comment