搭建Flarum一切成功但是测试邮箱、注册时显示糟糕出错啦(解决办法)

php8.2,php8.3用户安装flarum注意关闭display_errors!

不管是注册(实际注册成功但报错),还是SMTP邮件配置测试发送,以及一系列类似下面这种200报错的奇怪问题

`POST https://xxxxxxxxxx/register

<br />
<b>Deprecated</b>: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in <b>/www/wwwroot/inter-knot.com/vendor/fof/doorman/src/Listeners/ValidateDoorkey.php</b> on line <b>43</b><br />
<br />
<b>Fatal error</b>: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Output has been emitted previously; cannot emit response in /www/wwwroot/inter-knot.com/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:20
Stack trace:
#0 /www/wwwroot/inter-knot.com/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php(42): Laminas\HttpHandlerRunner\Exception\EmitterException::forOutputSent()
#1 /www/wwwroot/inter-knot.com/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(21): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->assertNoPreviousOutput()
#2 /www/wwwroot/inter-knot.com/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(75): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit()
#3 /www/wwwroot/inter-knot.com/vendor/flarum/core/src/Http/Server.php(45): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#4 /www/wwwroot/inter-knot.com/public/index.php(26): Flarum\Http\Server->listen()
#5 {main}
thrown in <b>/www/wwwroot/inter-knot.com/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php</b> on line <b>20</b><br />
`

记住关闭php display_errors!【建议加入安装教程】特殊说明。查了一早上查不到类似报错,就记得好像是个常见问题,但是又一下反应不过来哪里有问题。想了半天想起来了,以宝塔举例,去软件商店-以安装软件,php-设置,配置修改,关闭display_errors即可如图:

 


然后SMTP就不会“糟糕,出错啦”

posted @ 2024-08-13 09:04  hack747  阅读(111)  评论(0编辑  收藏  举报