WPCLI often gets out of memory error, while the site runs fine.

Abierto
#6,326 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Tranquilo
Stack tecnológico
php
Área
cli

Línea de trabajo

Start by reproducing wp plugin list with many large plugins and compare it with --skip-plugins in the reported PHP 8.4 Linux environment. Trace where the memory allocation failure occurs and identify whether the problem is in WP-CLI or plugin loading. Done means the command runs successfully without exceeding memory while the site remains unaffected.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug command:cli state:unconfirmed

Bug Report

--- ✅ If you are in the correct location now... --->

Describe the current, buggy behavior

Sometimes wp cli can run out of memory, while site itself is fine and not hitting the limit. This seems to be common among those sites with many large plugins. For example, one had these:

 wp plugin list --skip-plugins
+---------------------------+----------+-----------+---------+----------------+-------------+
| name                      | status   | update    | version | update_version | auto_update |
+---------------------------+----------+-----------+---------+----------------+-------------+
| all-in-one-wp-migration   | inactive | none      | 7.105   |                | off         |
| all-in-one-seo-pack       | inactive | none      | 4.9.7.2 |                | off         |
| pojo-accessibility        | active   | none      | 4.1.2   |                | on          |
| better-payment            | inactive | none      | 2.1.2   |                | off         |
| better-search-replace     | inactive | none      | 1.4.10  |                | on          |
| duplicate-page            | inactive | none      | 4.5.9   |                | off         |
| elementor                 | active   | none      | 4.1.1   |                | off         |
| elementor-pro             | active   | none      | 4.1.0   |                | off         |
| forminator                | active   | none      | 1.54.0  |                | on          |
| give                      | active   | none      | 4.15.3  |                | on          |
| image-optimization        | active   | none      | 1.7.4   |                | on          |
| mailpoet                  | active   | none      | 5.28.0  |                | off         |
| optinmonster              | inactive | none      | 2.16.24 |                | off         |
| reftagger                 | active   | none      | 2.4.7   |                | on          |
| sf-media                  | active   | none      | 1.3.4   |                | on          |
| google-site-kit           | active   | available | 1.179.0 | 1.180.0        | off         |
| site-mailer               | inactive | none      | 1.4.4   |                | off         |
| sliced-invoices           | inactive | none      | 3.10.0  |                | off         |
| analogwp-templates        | active   | none      | 2.6.5   |                | off         |
| the-events-calendar       | active   | none      | 6.16.3  |                | off         |
| boldgrid-backup           | inactive | none      | 1.17.2  |                | off         |
| userfeedback-lite         | inactive | none      | 1.11.2  |                | off         |
| w3-total-cache            | active   | none      | 2.9.4   |                | on          |
| wp-file-manager           | inactive | none      | 8.0.4   |                | off         |
| wpforms-lite              | active   | none      | 1.10.1  |                | on          |
| wp-mail-smtp              | active   | none      | 4.8.0   |                | on          |
| wp-statistics             | active   | none      | 14.16.8 |                | on          |
| wpvulnerability           | active   | none      | 5.0.0   |                | on          |
| wordpress-seo             | active   | none      | 27.7    |                | on          |
| advanced-cache.php        | dropin   |           |         |                | off         |
+---------------------------+----------+-----------+---------+----------------+-------------+

Andy wpcli command results in an error without "--skip-plugins":

wp plugin list
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
...

Describe how other contributors can replicate this bug

  • Install many many plugins
  • Try a wp cli command.

Describe what you expect as the correct outcome

WPCLI should run and run without exceeding memory limit while the site itself isn't hitting the limit.

Let us know what environment you are running this on

OS:	Linux 4.18.0-553.80.1.el8_10.x86_64 #1 SMP Mon Oct 20 03:57:49 EDT 2025 x86_64
Shell:	/usr/local/cpanel/bin/jailshell
PHP binary:	/opt/cpanel/ea-php84/root/usr/bin/php
PHP version:	8.4.21
php.ini used:	/opt/cpanel/ea-php84/root/etc/php.ini
MySQL binary:	/usr/bin/mariadb
MySQL version:	mariadb  Ver 15.1 Distrib 10.11.18-MariaDB, for Linux (x86_64) using readline 5.1
SQL modes:
WP-CLI root dir:	phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	phar:///usr/local/cpanel/3rdparty/share/cpanel-wp-cli/wp-cli.phar
WP-CLI packages dir:	/home/.../.wp-cli/packages/
WP-CLI cache dir:	/home/sf927076/.wp-cli/cache
WP-CLI global config:	/home/.../.wp-cli/config.yml
WP-CLI project config:
WP-CLI version:	2.12.0

Provide a possible solution

There doesn't seem to be a solution other than temporarily disabling some plugins. The website/dashboard doesn't seem to have the issue.

Provide additional context/screenshots

N/A

Lenguaje dominante
PHP
Estrellas
5.2k
Forks
1k
Merge medio
2 h 29 min
PR fusionados (30 d)
7

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de wp-cli/wp-cli

Todos los issues de wp-cli/wp-cli

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.