问题描述:
已经通过阿里云oss架设了兼容s3的云存储,但是在正确填写了正则表达式后只能发送gif格式图片,无法发送包括jpg和png在内其他格式的图片;txt文件也无法上传,但word等格式文件可以;
目前使用的是基于freeflarum架设的论坛,萌新还不知道怎么去调试或者导出论坛的php文件……现在比较怀疑是上传限制导致的报错,或者是正则配置出现错误。
报错内容:
糟糕,出错啦!请刷新页面重试。
调试模式报错内容:
log内容为:
[2022-06-11 04:35:43] flarum.ERROR: Intervention\Image\Exception\NotSupportedException: GD Library extension not available with this PHP installation. in /app/vendor/intervention/image/src/Intervention/Image/Gd/Driver.php:19
Stack trace:
#0 /app/vendor/intervention/image/src/Intervention/Image/ImageManager.php(112): Intervention\Image\Gd\Driver->__construct()
#1 /app/vendor/intervention/image/src/Intervention/Image/ImageManager.php(54): Intervention\Image\ImageManager->createDriver()
#2 /app/vendor/fof/upload/src/Processors/ImageProcessor.php(56): Intervention\Image\ImageManager->make()
#3 /app/vendor/fof/upload/src/Listeners/AddImageProcessor.php(33): FoF\Upload\Processors\ImageProcessor->process()
#4 /app/vendor/illuminate/events/Dispatcher.php(424): FoF\Upload\Listeners\AddImageProcessor->handle()
#5 /app/vendor/illuminate/events/Dispatcher.php(249): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}()
#6 /app/vendor/fof/upload/src/Commands/UploadHandler.php(151): Illuminate\Events\Dispatcher->dispatch()
#7 [internal function]: FoF\Upload\Commands\UploadHandler->FoF\Upload\Commands\{closure}()
#8 /app/vendor/illuminate/collections/Collection.php(695): array_map()
#9 /app/vendor/fof/upload/src/Commands/UploadHandler.php(192): Illuminate\Support\Collection->map()
#10 /app/vendor/illuminate/bus/Dispatcher.php(122): FoF\Upload\Commands\UploadHandler->handle()
#11 /app/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()
#12 /app/vendor/illuminate/pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#13 /app/vendor/illuminate/bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then()
#14 /app/vendor/illuminate/bus/Dispatcher.php(78): Illuminate\Bus\Dispatcher->dispatchNow()
#15 /app/vendor/fof/upload/src/Api/Controllers/UploadController.php(52): Illuminate\Bus\Dispatcher->dispatch()
#16 /app/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(115): FoF\Upload\Api\Controllers\UploadController->data()
#17 /app/vendor/flarum/core/src/Http/RouteHandlerFactory.php(41): Flarum\Api\Controller\AbstractSerializeController->handle()
#18 /app/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}()
#19 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ExecuteRoute->process()
#20 /app/vendor/kilowhat/flarum-ext-audit-free/src/Middlewares/SetLoggerActor.php(28): Laminas\Stratigility\Next->handle()
#21 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Kilowhat\Audit\Middlewares\SetLoggerActor->process()
#22 /app/vendor/flarum/core/src/Api/Middleware/ThrottleApi.php(33): Laminas\Stratigility\Next->handle()
#23 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\ThrottleApi->process()
#24 /app/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(44): Laminas\Stratigility\Next->handle()
#25 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\CheckCsrfToken->process()
#26 /app/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(67): Laminas\Stratigility\Next->handle()
#27 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ResolveRoute->process()
#28 /app/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle()
#29 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\SetLocale->process()
#30 /app/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(58): Laminas\Stratigility\Next->handle()
#31 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithHeader->process()
#32 /app/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle()
#33 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithSession->process()
#34 /app/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle()
#35 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\RememberFromCookie->process()
#36 /app/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle()
#37 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\StartSession->process()
#38 /app/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle()
#39 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\FakeHttpMethods->process()
#40 /app/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
#41 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ParseJsonBody->process()
#42 /app/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle()
#43 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\HandleErrors->process()
#44 /app/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle()
#45 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\InjectActorReference->process()
#46 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
#47 /app/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
#48 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\RequestHandler->process()
#49 /app/vendor/middlewares/base-path-router/src/BasePathRouter.php(101): Laminas\Stratigility\Next->handle()
#50 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePathRouter->process()
#51 /app/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle()
#52 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Laminas\Stratigility\Middleware\OriginalMessages->process()
#53 /app/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
#54 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePath->process()
#55 /app/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
#56 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ProcessIp->process()
#57 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
#58 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(65): Laminas\Stratigility\MiddlewarePipe->process()
#59 /app/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle()
#60 /app/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#61 /app/public/index.php(22): Flarum\Http\Server->listen()
#62 {main}
已尝试的解决办法:
修改正则配置,清空缓存,调整桶策略,目前的正则表达式如下:
^image\/.*
^text\/.*
上传文件大小限制为2M,已经启用了formatting和profile image crop,防盗链关闭,secure https开启
网址:
https://guforum.freeflarum.com/