Jump to content

PHP Extension with Berkeley DB


jives

Recommended Posts

Hi folks!

 

I'm having trouble getting BDB to work in my PHP extension, and I'm hoping you could help me out with some tipps :)

 

I'm writing an extension for PHP 5.2.6 under Windows XP/Server 2003 and IIS 5.1 / IIS 6.x, utilizing the latest Berkeley DB.

I'm using Visual C++ 2008 Express, and I've already complied the Berkeley DB DLL using the VC++ project bundled with the source, without any problems. My extension (linked against the BDB DLL) loads just fine into PHP, and I am able to call some BDB functions like db_version(), db_create(), db_env_create() and so on.

 

The problem is, that I'm however NOT able to call essential functions like db_open() or db_env_open() - I'm getting an errno 22 error (this is a standard C error, meaning "Invalid parameter"). The BDB-FAQ says regarding this error: http://www.oracle.com/technology/products/berkeley-db/faq/db_faq.html#8

 

But, if I build an executable for testing purposes using the very same code, everything works just fine.

 

I'm thinking this could be a problem with the way PHP "calls" the BDB functions used in my extension, but this is nothing more than a wild guess, really. Or, the PHP/IIS process might not have sufficient rights to create a DB file, although it has read and write rights on the test directory.

I've tired to link against an debug-build of the DLL, or changing the runtime-library of both DLLs (my extension and BDB), but nothing seems to help.

I don't really know what to do now, because I'm just using two APIs (PHP, BDB) here, which are supposed to work out-of-the-box ;) So, honestly speaking, I'm a bit lost here :(

 

Does anyone know something about this problem, or can somebody point me in the right direction?

 

Any reply is greatly appreciated! Thanks in advance :)

 

 

P.S.: I'm not using the dba extension built into PHP because I need every inch of performance I can get.

 

Link to comment
https://forums.phpfreaks.com/topic/123602-php-extension-with-berkeley-db/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.