I have around 1200 large images which I'd like to regenerate. I'm using the WP-CLI command wp media regenerate
. After around 61 images are generated, the terminal shows the message Killed
.
Why is this happening and how can I fix it?
I have around 1200 large images which I'd like to regenerate. I'm using the WP-CLI command wp media regenerate
. After around 61 images are generated, the terminal shows the message Killed
.
Why is this happening and how can I fix it?
Share Improve this question asked Apr 8, 2019 at 8:07 SamSam 2,1963 gold badges30 silver badges59 bronze badges 1- If the kernel killed it there will probably be an entry in /var/log/messages. – Rup Commented Apr 8, 2019 at 10:49
2 Answers
Reset to default 1Which version of WP-CLI are you using? What is wp --version
returning you?
Seems a little bit that you may be running out of memory as this is quite a large amount of images and there doesn't seem some proper batch processing implemented in version 1 of WP-CLI. At least, that's how I'd understand this issue WP-CLI issue Clear WP object cache periodically on media regenerate/import which I found in the WP-CLI v2.0.0 Release Notes.
Is upgrading WP-CLI an option for you? If not you could also install it as a project-local dependency using Composer. Maybe you need to init a bare bone Composer project with composer init
in your WordPress folder first.
$ cd /path/to/wordpress
$ composer require wp-cli/wp-cli-bundle:^2
$ vendor/bin/wp media regenerate
Had the same problem. wp media regenerate
would always get stuck at the same point with the Killed
message, even with the --only-missing
option.
In my case it was always after ID 571, so I tried wp media regenerate 570
, which was the next one, and it also failed with the same message. So I deleted this image from the media library and now it's working.
By the way, adding --debug
wouldn't give any hint about the problem. I also couldn't find any PHP logs about it.