• Resolved Einkoro

    (@einkoro)


    Have you tested the plugin under HHVM? I’ve been seeing the following error uploading PNGs – its a 1.6Mb PNG and it seems to work fine with PHP-FPM and a 128Mb memory_limit.

    Fatal error: request has exceeded memory limit in /home/username/www/wordpress/wp-includes/class-wp-image-editor-gd.php on line 130

    Bumping the memory_limit to 512Mb under HHVM results in the following error and the browser returning a 504:
    Fatal error: entire web request took longer than 50 seconds and timed out in /home/username/www/wp-content/plugins/ewww-image-optimizer/common.php on line 2015

    For reference the server is on the $80/mo plan from Digital Ocean so it should be sufficiently capable.

    I’ve also noticed the plugin starts to complain the dependencies are missing after HHVM has been running for a couple hours. Almost as if exec() stops working after awhile. Restarting HHVM seems to fix it briefly before it occurs again. I can poke around with xdebug if there is anything in particular that would be helpful.

    On a related note I have imagemagick installed – is there a reason its using GD instead?

    https://www.ads-software.com/plugins/ewww-image-optimizer/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    Nope, but that is a gigantic PNG, and will take a very long time to optimize, if it ever completes. You may need to increase your max_execution_time to around 5 minutes (maybe even more).

    The dependencies missing thing is weird though, seems like I saw that once before, but can’t remember what caused it. I’ll see if sleeping on it triggers any memories.

    And lastly, it should use imagemagick for conversions, even though it will still look for GD unless you’re saying that it doesn’t even detect Imagemagick?

    Thread Starter Einkoro

    (@einkoro)

    I’ll bump up the max execution time and drop the number of passes. Being able to disable EWWW during media_handle_upload() would probably be invaluable here as its a select member tier that has access to a upload form intended to submit PNG or TGAs of very high resolution assets. About 96 users in total but who knows what kind of crazy sized files they will throw at it. Particularly when the recommended DPI is 300.

    It doesn’t seem to be detecting imagemagick as the error occurs in class-wp-image-editor-gd.php rather than class-wp-image-editor-imagick.php

    As for the missing dependencies this sounds like it might be the issue if its exec failing:
    https://github.com/facebook/hhvm/issues/3340
    https://stackoverflow.com/questions/23266805/problems-with-hhvm-and-shell-exec

    Its a pain to reproduce since it seems to vary.

    Plugin Author nosilver4u

    (@nosilver4u)

    Ah, the wp-image-editor-imagick problem is because you need to actually install php-imagick. That’s the php module for imagemagick. EWWW uses the raw ImageMagick binary when doing conversion, but the wp_image_editor stuff that EWWW hooks into requires the php module.

    Thread Starter Einkoro

    (@einkoro)

    It looks like the imagick extension should be included in HHVM since 3.0:
    https://github.com/facebook/hhvm/issues/954
    https://github.com/facebook/hhvm/tree/master/hphp/runtime/ext/imagick

    Plugin Author nosilver4u

    (@nosilver4u)

    It does appear that way, you can doublecheck your loaded extensions by creating a php file with this:

    <?php phpinfo(); ?>

    Put it in your webfolder, and browse to it, and it will give you all the juicy details about your php setup. Search through that to see if imagick is loaded. There might be a directive that you have to enable, I’m not real familiar with HHVM (I know what it is, never used it though).

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Issues optimizing PNGs running with HHVM’ is closed to new replies.