Windows 10
Flarum 1.8.8
PHP 8.2.3
MySQL 10.11.2-MariaDB
FoF Upload 1.5.8
配置就是默认配置,本地上传,只支持图片。
上传和删除图片时总是报错说:糟糕,出错了,请刷新浏览器重试。
但是实际上图片已经传上去了,或者已经删除了。
php_errors.log:
[12-Nov-2024 13:40:48 UTC] PHP Deprecated: Optional parameter $upload declared before required parameter $contents is implicitly treated as a required parameter in D:\Server\pm\vendor\fof\upload\src\Adapters\Flysystem.php on line 51
[12-Nov-2024 13:40:48 UTC] PHP Fatal error: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Output has been emitted previously; cannot emit response in D:\Server\pm\vendor\laminas\laminas-httphandlerrunner\src\Exception\EmitterException.php:20
Stack trace:
#0 D:\Server\pm\vendor\laminas\laminas-httphandlerrunner\src\Emitter\SapiEmitterTrait.php(42): Laminas\HttpHandlerRunner\Exception\EmitterException::forOutputSent()
#1 D:\Server\pm\vendor\laminas\laminas-httphandlerrunner\src\Emitter\SapiEmitter.php(21): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->assertNoPreviousOutput()
#2 D:\Server\pm\vendor\laminas\laminas-httphandlerrunner\src\RequestHandlerRunner.php(75): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit(Object(Laminas\Diactoros\Response\EmptyResponse))
#3 D:\Server\pm\vendor\flarum\core\src\Http\Server.php(45): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#4 D:\Server\pm\public\index.php(26): Flarum\Http\Server->listen()
#5 {main}
thrown in D:\Server\pm\vendor\laminas\laminas-httphandlerrunner\src\Exception\EmitterException.php on line 20
已尝试的解决办法(演示网址或图片):
php.ini 中 exif 扩展已打开