使用GridFS和MongoDB处理大文件时出错 [英] Error on large files with GridFS and MongoDB

查看:73
本文介绍了使用GridFS和MongoDB处理大文件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试将大文件上传到MongoDB时似乎出现错误.

I seem to be getting an error when trying to upload large files into MongoDB..

Fatal error: Uncaught exception 'MongoGridFSException' with message 'could not open file ' in /home/jclark/thundergrid.fusionstrike.com/thundergrid/thundergrid.php:33 Stack trace: #0 /home/jclark/thundergrid.fusionstrike.com/thundergrid/thundergrid.php(33): MongoGridFS->storeUpload('pic', Array) #1 /home/jclark/thundergrid.fusionstrike.com/thundergrid/admin/index.php(7): Admin->upload() #2 {main} Next exception 'MongoGridFSException' with message 'error setting up file: ' in /home/jclark/thundergrid.fusionstrike.com/thundergrid/thundergrid.php:33 Stack trace: #0 /home/jclark/thundergrid.fusionstrike.com/thundergrid/thundergrid.php(0): MongoGridFS->storeUpload() #1 /home/jclark/thundergrid.fusionstrike.com/thundergrid/admin/index.php(7): Admin->upload() #2 {main} thrown in /home/jclark/thundergrid.fusionstrike.com/thundergrid/thundergrid.php on line 33

有没有得到我的理由,或者...

Is there a reason I'm getting these or...

非常感谢!

推荐答案

如果文件超过2GB/4GB,则这可能是对如何在平台上构建PHP的限制.在大多数情况下,不会启用LFS(大文件系统)(理论上,PHP开发团队也未正式支持它).您也有可能使用32位PHP编译,在这种情况下,您需要64位版本.

If the file is over 2GB/4GB, then this is likely a limitation on how PHP is build on your platform. In most cases, LFS (large file system) is not enabled (and theoretically it's not officially supported by the PHP dev team either). It is also possible that you are using a 32-bit compile of PHP as well, in which case you need a 64-bit build.

这篇关于使用GridFS和MongoDB处理大文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆