使用GridFS和MongoDB的大型文件出错

时间:2012-06-25 07:04:53

标签: php mongodb gridfs

在尝试将大文件上传到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

我有没有理由得到这些或......

非常感谢!

1 个答案:

答案 0 :(得分:1)

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