title: Allowed memory size of 138412032 bytes exhausted (tried to allocate 20480 bytes)
body: <p>I am trying to develop a PHP composer app with the <a href="https://github.com/maurobonfietti/rest-api-slim-php" rel="nofollow noreferrer">Slim PHP Framework</a>, and attempted to make the changes to the <code>migrations.php</code> file like this</p>
  
  <pre><code>&lt;?php
  
  declare(strict_types=1);
  
  require __DIR__ . '/../../src/App/App.php';
  
  try {
      $settings = $app-&gt;getContainer()-&gt;get('settings');
  
      $hostname = $settings['db']['hostname'];
      $username = $settings['db']['username'];
      $password = $settings['db']['password'];
      $database = $settings['db']['database'];
  
      $pdo = new PDO("mysql:host=$hostname", $username, $password); //Possibly the connection
      $pdo-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  
      $sql = "DROP DATABASE IF EXISTS $database";
      $pdo-&gt;exec($sql);
      echo "[OK] Database droped successfully" . PHP_EOL;
  
      $sql = "CREATE DATABASE $database";
      $pdo-&gt;exec($sql);
      echo "[OK] Database created successfully" . PHP_EOL;
  
      $sql = "USE $database";
      $pdo-&gt;exec($sql);
      echo "[OK] Database selected successfully" . PHP_EOL;
  
      $sql = file_get_contents(__DIR__ . '/../../database/database.sql');
      $pdo-&gt;exec($sql);
      echo "[OK] Tables created successfully" . PHP_EOL;
  //    echo "[OK] Records inserted successfully" . PHP_EOL;
      $data = file_get_contents(__DIR__ . '/../../database/companies.json');
      $array = json_decode($data, true);
      foreach($array as $row) {
          $relationships = $row["relationships"];
  
          $pdo-&gt;exec($sql);
  
      }
      echo "[OK] Json inserted into tables successfully" . PHP_EOL;
  
  
  
  } catch (PDOException $e) {
      echo "[ERROR] " . $e-&gt;getMessage() . PHP_EOL;
  }
  </code></pre>
  
  <p>I tried loading in a <code>companies.json</code> file, which is 78.5MB in size and when I ran <code>composer migration</code>, I ran into the error <code>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /.../extras/bin/migration.php on line 35</code>.</p>
  
  <p>I'm still using the same <code>composer.json</code> in the repo</p>
  
  <pre><code>  {
      "name": "maurobonfietti/rest-api-slim-php",
      "description": "Example of REST API with Slim PHP Framework.",
      "keywords": [
          "php",
          "slim-micro-framework",
          "rest-api",
          "mysql",
          "slim3",
          "slim",
          "rest",
          "api"
      ],
      "homepage": "https://github.com/maurobonfietti/rest-api-slim-php",
      "license": "MIT",
      "authors": [
          {
              "name": "Mauro Bonfietti",
              "email": "mauro.bonfietti@gmail.com",
              "homepage": "https://github.com/maurobonfietti"
          }
      ],
      "require": {
          "firebase/php-jwt": "^5.0",
          "palanik/corsslim": "dev-slim3",
          "predis/predis": "^1.1",
          "respect/validation": "^1.1",
          "slim/slim": "^3.12.2",
          "vlucas/phpdotenv": "^2.4"
      },
      "require-dev": {
          "phpstan/phpstan": "^0.12",
          "phpunit/phpunit": "^9.0"
      },
      "config": {
          "sort-packages": true
      },
      "autoload": {
          "psr-4": {
              "App\\": "src/",
              "Tests\\": "tests/"
          }
      },
      "scripts": {
          "coverage": "phpunit --coverage-html=coverage --coverage-text",
          "database": "extras/bin/restart-api.sh",
          "restart": "extras/bin/restart-api.sh",
          "migration": "php extras/bin/migration.php",
          "start": "php -S 0.0.0.0:8080 -t public public/index.php",
          "test": "phpunit"
      }
  }
  </code></pre>
  
  <p>and I have added a <code>php.ini</code> file to my repository at <code>/docker/php7/php.ini</code> from <a href="https://webhost.ai/download-default-php-ini-files/#download-default-php-ini" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Does anyone mind telling me how to increase the memory limit for my application? I'm quite new to PHP. Let me know if more clarification is needed</p>