Drush out of memory

If you are getting PHP out of memory errors using drush try this.


php -r 'print ini_get("memory_limit") . "\n";'


php -i | grep memory

Check memory from the folder in which you are running your PHP commands. It may be overridden by a php.ini you didn’t know about. 

Locate the php.ini file:

php -i | grep php.ini


Loaded Configuration File    /opt/cpanel/ea-php72/root/etc/php.ini 

Cpanel in this case is overriding the php file in the home directory and in the root drupal folder.