lsky-org/lsky-pro

手机上传图片 提示服务端异常

520mhj opened this issue · 2 comments

520mhj commented

兰空V 2.1,电脑上传21兆的图片没问题,手机上传提示服务端异常,请稍后再试 。 其实图片也上传上去了。我新创建的WebDav存储策略
求大佬解答
这是storage/logs的日志文件
[2023-09-07 15:17:11] prod.ERROR: 生成缩略图时出现异常 {"file":"/www/wwwroot/img.top/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FitCommand.php","line":33,"message":"cache resources exhausted `/tmp/phpMSawpB' @ error/cache.c/OpenPixelCache/4083","trace":"#0 /www/wwwroot/img.top/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FitCommand.php(33): Imagick->cropImage()
#1 /www/wwwroot/img.top/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php(94): Intervention\Image\Imagick\Commands\FitCommand->execute()
#2 /www/wwwroot/img.top/vendor/intervention/image/src/Intervention/Image/Image.php(108): Intervention\Image\AbstractDriver->executeCommand()
#3 /www/wwwroot/img.top/app/Services/ImageService.php(569): Intervention\Image\Image->__call()
#4 /www/wwwroot/img.top/app/Services/ImageService.php(270): App\Services\ImageService->makeThumbnail()
#5 /www/wwwroot/img.top/app/Http/Controllers/Controller.php(129): App\Services\ImageService->store()
#6 /www/wwwroot/img.top/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\Controller->upload()
#7 /www/wwwroot/imgtop/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction()

wisp-x commented

21 兆的图片处理失败可能和 PHP 的内存限制有关,默认 128M,imagick 拓展在处理图片时会占用大量内存。
至于你描述的错误应该和当前日志无关,有可能是上传时间太长导致请求被 nginx 超时限制或 php 的脚本运行时间限制 kill 了。

520mhj commented

@wisp-x 好的 我试一下 多谢多谢