MySQLi Database Driver for Kohana 3.3

A couple of months ago I published my Kohana MySQLi database driver on GitHub. As the development of the framework came to a halt for the last few months the PHP team deprecated the support for the PHP MySQL extension on which Kohana’s default Database driver relies. This module is based on Kohana’s native implementation but uses the MySQLi extension.

A composer description is available in the repository so it can be easily installed using the package manager.

  • Vinsent Chitekwe

    Hi Tom. I am getting:

    ErrorException [ Fatal Error ]: Call to undefined function mysqli_connect()

    database.php:
    ‘default’ => array
    (
    ‘type’ => ‘MySQLi’,
    ‘connection’ => array(

    bootstrap.php
    ‘mysqli’ => MODPATH.’mysqli’,

    • Tom

      Hi Vinsent,

      mysqli_connect() is an alias of the MySQLi constructor that is part of the PHP MySQLi database extension. This extension is installed on most hosting solutions. If you are running PHP yourself (development environment, VPS) ensure that the MySQLi extension is installed.

      For example, on Ubuntu:
      sudo apt-get install php5-mysql

      • Vinsent Chitekwe

        Hi Tom
        Thanks. I am now getting:

        php5-mysql : Depends: phpapi-20121212
        Depends: php5-common (= 5.5.9+dfsg-1ubuntu4.19) but 5.4.9-4ubuntu2.4 is to be installed

        • Tom

          You could try to reinstall the php-common package and see if you are able to install the php-mysql package then. You could try the following on a non critical environment at your own risk:

          apt-get install –reinstall php5-common

          • Vinsent Chitekwe

            Thanks man

  • Brian Stanback

    Thank you, came in handy updating a legacy app to work with PHP 7.x.