EDIT: It works when I change the PHP version to 8.1
Original message:
On a fresh installed flarum, when I try to send the test email I get this:
POST https://forum.wibble.news/api/mail/test
<br />
<b>Deprecated</b>: Callables of the form ["Swift_SmtpTransport", "Swift_Transport_EsmtpTransport::__construct"] are deprecated in <b>/var/www/flarum/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php</b> on line <b>36</b><br />
<br />
<b>Deprecated</b>: Callables of the form ["Swift_Message", "Swift_Mime_SimpleMessage::__construct"] are deprecated in <b>/var/www/flarum/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php</b> on line <b>46</b><br />
<br />
<b>Fatal error</b>: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Unable to emit response; headers already sent in /var/www/flarum/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php:36 in /var/www/flarum/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:15
Stack trace:
#0 /var/www/flarum/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php(38): Laminas\HttpHandlerRunner\Exception\EmitterException::forHeadersSent('/var/www/flarum...', 36)
#1 /var/www/flarum/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(21): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->assertNoPreviousOutput()
#2 /var/www/flarum/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(75): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit(Object(Flarum\Api\JsonApiResponse))
#3 /var/www/flarum/vendor/flarum/core/src/Http/Server.php(45): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#4 /var/www/flarum/public/index.php(26): Flarum\Http\Server->listen()
#5 {main}
thrown in <b>/var/www/flarum/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php</b> on line <b>15</b><br />
I installed Flarum using this dockerfile:
FROM composer/composer as composer
WORKDIR /app
RUN composer create-project flarum/flarum
FROM php:apache
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
curl \
libmemcached-dev \
libz-dev \
libpq-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev \
libssl-dev \
libwebp-dev \
libxpm-dev \
libmcrypt-dev \
libonig-dev;
RUN set -eux; \
docker-php-ext-install pdo_mysql; \
docker-php-ext-configure gd \
--prefix=/usr \
--with-jpeg \
--with-webp \
--with-xpm \
--with-freetype; \
docker-php-ext-install gd;
COPY --from=composer /app/flarum /app/flarum
COPY flarum.conf /etc/apache2/sites-enabled/
RUN a2enmod rewrite
VOLUME ["/var/www/flarum"]
WORKDIR /var/www/flarum
COPY entrypoint.sh /entrypoint.sh
CMD /entrypoint.sh