Loading...
 
Skip to main content

Architecture / Installation


"could not find driver" error after install of tikiwiki 4.x

I wanted to post this because it is not an easy error to figure out. It is actually addressed here: http://tikiwiki.org/ReleaseNotes40Question

"Installation
When installing Tiki 4.0 with PHP 5.1.0 (or higher), you may encounter a System error: could not find driver message. This indicates that PDO driver for your database has not been enabled on your server.

To enable the driver:

* For Unix:
Refer to http://us.php.net/manual/en/book.pdo.phpQuestion (external link) for information on installing PDO support.
As an alternative, add the following statement to the end of your ../db/local.php file, before the ?>:
$api_tiki='adodb';


* For Windows:
Add the following statement to your php.ini file:
extension=php_pdo_mysql.dll "

I don't quite understand why someone has not modified the code to produce a better error, because this one is 100% vague. Two of us searched for about 6 hours before figuring it out. The error is produced on line 57 (approx) of tiki-db-pdo.php.

The error occurs here: lines 169 to 172 in tiki-db.php which are as follows:

$dbInitializer = 'db/tiki-db-adodb.php';
if (extension_loaded("pdo") and $api_tiki == 'pdo' ) {
$dbInitializer = 'db/tiki-db-pdo.php';
}

This is basically forcing tikiwiki 4.0 to use PDO to connect to the DB... My server actually has PDO enabled, but the error still occured... I guess the server has a configuration problem (on a hybrid server). Anyway, I commented out the lines as follows:

$dbInitializer = 'db/tiki-db-adodb.php';
//if (extension_loaded("pdo") and $api_tiki == 'pdo' ) {
//$dbInitializer = 'db/tiki-db-pdo.php';
//}

And tikiwiki 4.x now works seamlessly.

I think that this needs to be an option in the tikiwiki 4.x installation wizard (insert a conditional to use mysql driver??), because there is almost no way to figure this error out easily, which is another thing that needs to be addressed.

(by the way, the tikiwiki 4.1 download on sourceforge links to tikiwiki 3.x)