有人有使用 berkeley db 和 PHP 的经验吗?

发布于 2024-09-06 13:42:12 字数 125 浏览 6 评论 0原文

我必须访问和写入其他应用程序共享的一些伯克利数据库文件。

我真的没有找到任何关于在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

椵侞 2024-09-13 13:42:12

这不是 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

通知家属抬走 2024-09-13 13:42:12

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文