views:

2003

answers:

4

Does anyone know how, on Ubuntu 8.04, with PHP 5 and MySQL 5.0, to enable/install the mysqli package/extensions?

Preferably I'd like to preserve the existing installations, but, if necessary, I'll reinstall from scratch.

I realise it's not, technically, programming-related but, I think (at a stretch, maybe) it's programming-enabling? hopes

Thanks for any help you're able to provide.

A: 

I Found this hope it helps.

You might have to install php with the mysqli option: apt-get install php5-mysqli

MrHus
That link seems to be about how to install the LAMP stack, which I already have, and says nothing about installing/enabling mysqli for php. But thank you still, it was an interesting read :)
David Thomas
A: 

I think you can just do

apt-get install php5-mysqli
David Caunt
+2  A: 

From the PHP documentation.

To ensure that the mysqli extension for PHP is enabled, you will need to configure the PHP source code to use mysqli. This is achieved by running the configure script with the option --with-mysqli=mysql_config_path/mysql_config, prior to building PHP. This will enable mysqli and it will use the MySQL Client Library (libmysql) to communicate with the MySQL Server.

But since you are on ubuntu. You can just install the mysqli package. Details about it here.

sudo apt-get install php5-mysqli
Ólafur Waage
I'm sorry, but how? My noob-ness is extreme at this point, I'm afraid. I may need hand-holding. Or a piggy back ride through the difficult parts. *blush*
David Thomas
The install command is there at the bottom.
Ólafur Waage
Appreciated, it wasn't there (for some reason) when I looked first. Or I missed it...*blush* umm: sudo apt-get mysqli gives "E: Package php5-mysqli has no installation candidate." And the suggested replacement, php-mysql, package is already the latest version.
David Thomas
You could try installing php5-pdo, if PDO is suitable for your application. I think you'll just need apt-get install php5-pdo-mysql but i cant remember the package name for certain.
David Caunt
+2  A: 

In Ubuntu Hardy (8.04) mysqli is part of the php5-mysql package along with the standard mysql library and pdo - see http://packages.ubuntu.com/hardy/php5-mysql for more info.

sudo apt-get install php5-mysql
muffinresearch