Troubleshooting

WP-CLI Error: Allowed memory size of 999999 bytes exhausted

If you run into a PHP fatal error relating to memory when running wp package install, you’re likely running out of memory.

WP-CLI uses Composer under the hood to manage WP-CLI packages. However, Composer is a bit of a memory hog, so you’ll need to increase your memory limit to accommodate it.

Edit your php.ini as a permanent fix:

# Find your php.ini for PHP-CLI
$ php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/etc/php/7.0
Loaded Configuration File => /usr/local/etc/php/7.0/php.ini
# Increase memory_limit to 512M or greater
$ vim /usr/local/etc/php/7.0/php.ini
memory_limit = 512M

Sources: https://make.wordpress.org/cli/handbook

Related Articles