The issue
Flarum reported an error when running. After asking ChatGPT, I learned that it might be a compatibility issue.
I'm from China, my English may not be good, I will use a translator.
ChatGPT's Answer
The error messages you are encountering indicate two distinct issues with your Flarum installation:
Deprecated Property Creation: This warning indicates that the creation of dynamic properties is deprecated. This is likely due to PHP 8.2 or later, where the creation of dynamic properties is no longer allowed by default.
Solution: Update the code to explicitly declare the property, or suppress the warning if it's safe to do so temporarily.
Example fix:
class PostWasUnliked {
// Declare the property
public $actor;
}
Fatal Error with Laminas Emitter: This error indicates that there has already been output sent to the browser before the response is being emitted.
Although ChatGPT gives me an error, I don't know how to fix it.
ChatGPT indicates that this is most likely due to using PHP 8.2 or higher, where creation of dynamic properties is no longer allowed by default.
Flarum information
<br />
<b>Deprecated</b>: Creation of dynamic property Flarum\Likes\Event\PostWasUnliked::$actor is deprecated in <b>/dr1/www/wwwroot/bbs/vendor/flarum/core/src/Foundation/DispatchEventsTrait.php</b> on line <b>31</b><br />
<br />
<b>Fatal error</b>: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Output has been emitted previously; cannot emit response in /dr1/www/wwwroot/bbs/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:20
Stack trace:
#0 /dr1/www/wwwroot/bbs/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php(42): Laminas\HttpHandlerRunner\Exception\EmitterException::forOutputSent()
#1 /dr1/www/wwwroot/bbs/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(21): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->assertNoPreviousOutput()
#2 /dr1/www/wwwroot/bbs/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(75): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit()
#3 /dr1/www/wwwroot/bbs/vendor/flarum/core/src/Http/Server.php(45): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#4 /dr1/www/wwwroot/bbs/public/index.php(26): Flarum\Http\Server->listen()
#5 {main}
thrown in <b>/dr1/www/wwwroot/bbs/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php</b> on line <b>20</b><br />