0

This question already has an answer here:

I'm trying to use drupal migration module with drush to migrate a database. I'm getting this error below. Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /Applications/XAMPP/xamppfiles/htdocs/drupal-eight-iom/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php on line 76

I have already tried editing the memory_limit on php.ini file

memory_limit=5024MB

Not sure what else I need to do in order to make it work. I'm using Drupal 8.4.4

$databases['default']['default'] = array (
  'database' => 'drupal-eight-iom',
  'username' => 'root',
  'password' => '',
  'prefix' => '',
  'host' => '127.0.0.1',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

$databases['upgrade']['default'] = array (
    'database' => 'drupal-seven-iom',
    'username' => 'root',
    'password' => '',
    'prefix' => '',
    'host' => '127.0.0.1',
    'port' => '3306',
    'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
    'driver' => 'mysql',
  );


$settings['install_profile'] = 'standard';
$config_directories['staging'] = 'sites/default/config';
$config_directories['sync'] = 'sites/default/files/config_zB_DnNUK68i5Owp5a8FzTiClQfp3d3jrwcy0_HuS1hNCGv9Y_Iva2Ahm8LCH-P0j0M2jwmQAsA/sync';

marked as duplicate by kenorb, Community Jan 11 '18 at 12:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    134217728 bytes is ~134mb, not 5024mb. Your memory limit override isn't taking effect. If you're on a shared host, they do that deliberately to stop people taking more than their fair share of resources – Clive Jan 11 '18 at 11:43
  • 1
    @Clive: He most probably isn't. I don't know any serious Shared Hosting providers using XAMPP. ;) - But to let me learn something as well: Would this question be considered Drupal Answers Off-Topic? My first guess was 'yes'... – Mario Steinitz Jan 11 '18 at 11:53
  • Hah @Mario, I missed that ;) Yeah this is more of a general xampp issue than Drupal – Clive Jan 11 '18 at 11:58
3

You need to check for the right php.ini file. Be aware, that drush is using the CLI (command line interface) version of PHP, which might use a different php.ini file than the version used by your web server.

Your above error message states, that the CLI version has a memory limit of 128MB only (which is the default value that might even be used when there is no php.ini file for your PHP version).

In Windows you can find out the used php.ini file - or the folder where it is expected - by typing the following command to your Windows command prompt:

php -i | findstr /c:"php.ini"

In Unix compatible systems you could use grep instead:

php -i | grep "php.ini"

Not the answer you're looking for? Browse other questions tagged or ask your own question.