尝试存储数组时 CHDB 缓存错误
我正在尝试对 PHP 使用 CHDB(哈希表缓存)(http://pecl.php.net/package/chdb)。
我最终遇到了这个错误:
致命错误:未捕获异常“异常”,消息为“错误” 生成'd.chdb':无法分配内存' /var/www/b/site/test.php:18 堆栈跟踪:#0 /var/www/b/site/test.php(18): chdb_create('d.chdb', Array) #1 {main} 在第 18 行 /var/www/site/b/test.php 中抛出
有谁知道这个错误来自哪里?是来自 PHP 框架本身还是其他地方?
我在 Fedora 11 上的 PHP 中手动安装了 CHDB。
我的代码非常简单:
$data = array('key1' => "val1");
chdb_create("d.chdb", $data);
欢迎任何有用的提示!
I'm trying to use CHDB (hash table caching) for PHP (http://pecl.php.net/package/chdb).
I end up with this error:
Fatal error: Uncaught exception 'Exception' with message 'Error
generating 'd.chdb': Cannot allocate memory' in
/var/www/b/site/test.php:18 Stack trace: #0
/var/www/b/site/test.php(18): chdb_create('d.chdb', Array) #1 {main}
thrown in /var/www/site/b/test.php on line 18
Does anyone know where this error comes from? Is it from the PHP framework itself or from somewhere else?
I manually installed CHDB in PHP on Fedora 11.
My code is very straightforward:
$data = array('key1' => "val1");
chdb_create("d.chdb", $data);
Any helpful tips welcome!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我没有详细查看 CHDB 源代码,但“无法分配内存”消息实际上可能会翻译为“无法打开文件”。
我刚刚快速浏览了源代码(您可以在 https://github.com/lcastelli 找到它/chdb),该异常似乎来自此处< /a>,但是我不知道它实际上试图在哪里写入文件。我自己从未尝试过使用它。
I haven't looked at the CHDB source in detail, but it's possible that "unable to allocate memory" message actually translates as "unable to open file".
I've just had a quick browse through the source code (you can find it at https://github.com/lcastelli/chdb), and that exception appears to come from here, but I've no idea where it's actually trying to write its files. Never tried using it myself.
chdb 的程序员回答了我的问题,问题是 chdb 使用的 cmph 库不允许对大小为 1 的数组进行散列。我使用了一个条目只是为了测试...
就这么简单:-)。
显然错误信息有点不清楚。
The programmer of chdb answered my question and the problem is that cmph library used by chdb does not allow hashing of arrays with size one. I used one entry just to test...
Simple as that :-).
Obviously the error message is a bit unclear.