Solved wp cli and Wordpress Manager not uses php modifications

castris

Verified User
Joined
Apr 16, 2021
Messages
111
Location
Arcenillas
HI

I can't find how to work on modifying the PHP memory value for version X, but for CLI.

The problem is clear:

The WordPress Manager tool uses wp-cli and it is limited to 128MB.

Code:
❯ wp PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 47526080 bytes) in /home/unilanges/domains/MYDOMAIN.ES/public_html/wp-includes/class-wpdb.php on line 2320 Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 47526080 bytes) in /home/unilanges/domains/MYDOMAIN.ES/public_html/wp-includes/class-wpdb.php on line 2320 PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 47526080 bytes) in /home/unilanges/domains/MYDOMAIN.ES/public_html/wp-includes/class-wpdb.php on line 2320 Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 47526080 bytes) in /home/unilanges/domains/MYDOMAIN.ES/public_html/wp-includes/class-wpdb.php on line 2320


Usr like use WordPress Manager, and in his domain has memory_limit for version PHP that use.

But Manager and shell, use php -cli and this, has limita to 128M

Any solution ?
 
Can you be a bit more clear? Beause 128M is the same as 128MB. The M stands for MB and in php.ini only M is used.
One can rise the memory amount both in the account under the php settings.

Otherwise you can create a .user.ini in the public_html and add this line:
memory_limit = 256M
or other value you want. In some cases .htaccess can be used too.
 
But Manager and shell, use php -cli and this, has limita to 128M

When you run PHP CLI it uses only system wide INI files, and ignores settings for a web environment. If PHP has the limit of memory set to 128M, then that's the value specified in php.ini. And you will need to update it. It will be effect all users in CLI and WEB. But in WEB environment individual settings will take a precedence.
 
I got confused with the issue, and I saw it today.

It's already resolved, but I don't remember how. I think the issue was solved by modifying the wp-config.php and increasing the memory in WP_MEMORY_LIMIT, since WP CLI reads that configuration, and from that point, it's no longer a PHP-CLI issue.

A lot of thanks @zEitEr @Richard G
 
Back
Top