Migrating from 7.12 to 8.2 with Symfony errors

I am trying to upgrade from 7.12 to 8.2, following the instructions here SuiteCRM 7.12.x migration to SuiteCRM 8.x :: SuiteCRM Documentation

Running the command:

./bin/console suitecrm:app:setup-legacy-migration

I’m getting a number of errors, with one critical one:

CRITICAL [console] Error thrown while running command “suitecrm:app:setup-legacy-migration”. Message: “Failed to start the session because headers have already been sent by “/[my-path]/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php” at line 17.” [“exception” => RuntimeException { …},“command” => “suitecrm:app:setup-legacy-migration”,“message” => “Failed to start the session because headers have already been sent by “/[my-path]/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php” at line 17.”]

In NativeSessionStorage.php line 152:

Failed to start the session because headers have already been sent by “/[my-path]/vendor/symfony/http-foundation/Ses
sion/Attribute/AttributeBag.php” at line 17.

suitecrm:app:setup-legacy-migration

It seems like others have also had similar problems Upgrade problem Suitecrm 8.1.0 to 8.1.2 Failed to start the session, or other problems with Symphony.

I’m using MAMP (https://www.mamp.info) to try the migration locally, the server setup looks compatible to me, but not sure if this could be an issue.

Did someone else have this problem and manage to solve it?