500 Error When Migrating To Drupal 8
For the out of memory problem see https://lab.civicrm.org/dev/drupal/-/issues/119 and the workarounds in there, which should then allow logging the actual problem.

Also that stackexchange article is old and a bit out of date, although the gist of it is right. But you might want to use this method instead of roundearth, and the civicrm.settings.php entries are a little different from the roundearth one. The other method should set the civicrm.settings.php settings for you.