使用 GridFS 和 MongoDB 的大文件出错


Error on large files with GridFS and MongoDB

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

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

非常感谢!

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