silent1mezzo
silent1mezzo

Reputation: 2942

Connecting to DB2 through PHP

I'm trying to connect to a DB2 databse from a windows machine using XAMPP.

When I try to load the php_ibm_db2 module I get the following error

"PHP Startup: ibm_db2: Unable to initialize module Module compiled with module API=20060613 PHP compiled with module API=20090626 These options need to match"

How do I fix this and connect to a db2 database?

Upvotes: 0

Views: 4976

Answers (3)

MikeC
MikeC

Reputation: 51

The top answer got close but didn't have the right php_ibm_db2.dll I needed for PHP 5.3.2 VC9 (windows) NTS (non-thread-safe). But I found one that has it - and many more! Link:

PHP IBM DB2 DLLs on SourceForge via Technology Explorer for DB2

Upvotes: 0

Pascal MARTIN
Pascal MARTIN

Reputation: 401172

This means you are trying to use an old (it seems : it's from 2006) version of the imb_db2 .dll file, with a recent (it's from 2009) version of PHP. You should use the same version for both PHP and the extension.

There is a recent version of some extensions .dll available from http://downloads.php.net/pierre/ ; amongst those, there is a couple of versions of php_ibm_db2.dll 1.8 ; with a bit of luck, maybe they'll match your version of PHP -- and there are versions for both PHP 5.2 and 5.3.

Upvotes: 1

Tim
Tim

Reputation: 13258

You have different "versions": 20060613 and 20090626

Did you compile these by yourself? Re-compile it.

Upvotes: 0

Related Questions