在我的桌面上运行开发和制作模式,上传和调整任何大小的图像都可以正常运行。在运行apache / passenger设置的服务器上,任何超过1 MB的图像文件都会返回两个错误之一
Command :: identify -format %wx%h '/tmp/243.jpg20120504-2852-ryheox[0]'
Command :: convert '/tmp/243.jpg20120504-2852-ryheox[0]' -resize "400x400" '/tmp/24320120504-2852-l69yg'
[paperclip] An error was received while processing: #<Paperclip::Error: There was an error processing the thumbnail for 243>
Command :: identify -format %wx%h '/tmp/243.jpg20120504-2852-ryheox[0]'
Command :: convert '/tmp/243.jpg20120504-2852-ryheox[0]' -resize "200x200" '/tmp/24320120504-2852-g957f'
[paperclip] An error was received while processing: #<Paperclip::Error: There was an error processing the thumbnail for 243>
或
Command :: identify -format %wx%h '/tmp/046.jpg20120504-946-1w1106[0]'
[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: /tmp/046.jpg20120504-946-1w1106 is not recognized by the 'identify' command.>
Command :: identify -format %wx%h '/tmp/046.jpg20120504-946-1w1106[0]'
[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: /tmp/046.jpg20120504-946-1w1106 is not recognized by the 'identify' command.>
较小的文件没有问题。
我有大约3 GB的可用磁盘空间,在尝试上传文件时,我的空闲内存从不低于60MB,并且有300MB的交换空间。
我缺少一些特殊的设置吗?环境生产文件是创建rails应用程序时生成的任何内容。
编辑:
我可以上传超过50MB的视频文件并存储它们。
答案 0 :(得分:0)
将nginx.conf中的client_max_body_size更改为您想要的任何大小
编辑:尝试添加
LimitRequestBody 15000000
到你的apache conf文件