5

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.

David Thomas
  • 249,100
  • 51
  • 377
  • 410

4 Answers4

9

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
  • 380
  • 2
  • 10
3

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

HaNdTriX
  • 28,732
  • 11
  • 78
  • 85
MrHus
  • 32,888
  • 6
  • 31
  • 31
  • 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 Apr 03 '09 at 13:19
  • I solved this problem by installing the php5-mysqlnd package. This package uses the native driver (hence the trailing "nd" in the package name). Alternatively, you could use the php5-mysql package for the traditional library. Either way, the package contains mysql, mysqli, and pdo_mysql support. – Anthony DiSanti Oct 08 '12 at 07:25
2

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
GEOCHET
  • 21,119
  • 15
  • 74
  • 98
Ólafur Waage
  • 68,817
  • 22
  • 142
  • 198
  • 1
    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 Apr 03 '09 at 13:21
  • 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 Apr 03 '09 at 13:27
  • 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 Snabel-Caunt Apr 03 '09 at 13:31
0

With PHP5 php5-mysqli package is not available, but it is replaced by another package. May be package is obsolete.

It can be downloaded by the following command

sudo apt-get install php5-mysqlnd
Ram
  • 3,092
  • 10
  • 40
  • 56