开发者

Does anyone have any experience using berkeley db with PHP?

I have to acc开发者_开发百科ess and write to some berkeley db files that other applications share.

I really haven't found anything out there about using this with PHP. It really doesn't seem very popular.

Does anyone have any links or resources that I might be able to use to get things rolling?

Thanks!


Isn't this what the dba functions are for?
http://php.net/manual/en/book.dba.php

I've had some code some years ago with that. Didn't use it much however, because it was a somewhat inefficient data store. And it seems kind of pointless in the light of SQLite now anyway. But btw: http://schlueters.de/blog/archives/134-Berkeley-DB-5-and-PHP.html


Berkley DB isn't really meant for multi-user access. It is much better for an embedded database that is accessed by one process.

PHP processes run asyncronously on the web site. This means a php script accessing a Berkley DB has to rely on file locking to handle concurrent access.

This is very inefficient. thus no BDB support in php.

If you want to use BDB in a multi-user environment, you should write a web service in perl/c/python/etc that talks to BDB, and accepts connections from php. Or you could just use a real db server like mysql, postgres or something and save yourself the headache.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜