有人有使用 berkeley db 和 PHP 的经验吗?
我必须访问和写入其他应用程序共享的一些伯克利数据库文件。
我真的没有找到任何关于在 PHP 中使用它的信息。看起来确实不太受欢迎。
有谁有任何链接或资源可供我用来让事情顺利进行吗?
谢谢!
I have to access 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不是 dba 功能的用途吗?
http://php.net/manual/en/book.dba.php
几年前我已经编写过一些代码。然而并没有太多使用它,因为它是一个效率较低的数据存储。无论如何,从现在的 SQLite 来看,这似乎毫无意义。但顺便说一句: http://schlueters.de/blog /archives/134-Berkeley-DB-5-and-PHP.html
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 并不是真正适合多用户访问的。对于由一个进程访问的嵌入式数据库来说要好得多。
PHP 进程在网站上异步运行。这意味着访问 Berkley DB 的 php 脚本必须依赖文件锁定来处理并发访问。
这是非常低效的。因此 php 中不支持 BDB。
如果你想在多用户环境中使用 BDB,你应该在 perl/c/python/etc 中编写一个与 BDB 对话的 Web 服务,并接受来自 php 的连接。或者你可以使用真正的数据库服务器,比如 mysql、postgres 等,这样就省去了麻烦。
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.