Enable WebP Support for ImageMagick in PHP 7.4 (ea)
Hi, we're trying to see if it's possible to enable WebP support for the ImageMagick library (Imagick module) in PHP 7.4? We have a dedicated server running CloudLinux 7.9 and WHM v92.0.11.
We had our server admin team recently add an EasyApache 4 version of PHP 7.4 for us to assign to certain users, and along with that we had them install and enable ImageMagick. So we are now showing PHP 7.4.15, Imagick module 3.4.4, and ImageMagick 6.9.10-68 Q16. BUT, under supported formats, WebP is not listed as one of the many options. We need this option to allow ImageMagick to convert images to WebP format in some WordPress sites.
We are aware that the GD library does have WebP support, but it lacks a few more advanced features that ImageMagick has to get better quality image resizing & optimizing that WordPress does on all uploaded images.
We contacted our server admins about adding WebP support with the libwebp library but were informed that this was not possible with newer versions of PHP due to cPanel limitations.
- Is it true that ImageMagick cannot be compiled to support WebP currently for PHP 7.4 on a WHM/cPanel server?
- Is it possible to get the cwebp tool added to PHP 7.4, along with libwebp, and try that system if ImageMagick cannot be updated at this point?
Thanks for any insight here! We'd love to not have to use outside resources to convert images to WebP on sites when the feature 'should' be supported by the tool that is already doing all of the resizing of thumbnails by default when images are uploaded.
-
Hi cP Rex, thanks for the quick reply. Yes, as mentioned, we are aware that WebP is supported in GD. We do have that option currently. But as also mentioned, we would prefer to use ImageMagick, as that has some advanced features that we prefer to utilize. For instance, ImageMagick allows the option to retain ICC Profiles, where GD does not. We prefer to retain profiles for best color consistency across all platforms. There are a couple other options as well. - Anyone have any insight on enabling this for ImageMagick? 0 -
CloudLinux does often go above and beyond the packages that are included with CentOS, so you may be able to use alt-php to get that tool working if you have a CloudLinux machine. I can't speak to the instructions in that article as we don't recommend trying to install things from source on a cPanel server as there could be conflicts either immediately or with future updates. 0 -
Hi, thanks for the reply! Much appreciated. We actually had our sys admin try to install & compile ImageMagick from scratch, adding WebP support. But in the end we started getting a bunch of 'php-cgi killed by SIGSEGV' error notifications when uploading images using the EA4 versions of PHP after this. With CentOS & CloudLinux both having their own versions of ImageMagick/Imagick, and the additional restrictions cPanel may add, it was just a bit too convoluted to make it happen in a reliable fashion, and feel safe leaving it with anything beyond what is 'stock', especially in regards to future updates. So we reverted everything back to what is stock/default. We had noticed that the ALT-PHP (CloudLinux) version of Imagick WAS compiled with WebP support, so we just figured we'd use that on accounts that really needed this feature. But alas, the version of libwebp that CloudLinux includes by default to give the WebP support to Imagick is ANCIENT (v.0.3.0 from 2013 or something?!?). So all of our efforts to enable an option of WebP we really need for quality (use-sharp-yuv) failed until we realized that option wasn't added until v.0.6.0 (2017). So I now have a ticket with the CloudLinux team trying to find out why such an ancient version of libwebp is included, and if that can be updated. We've already learned the hard way not to try to go beyond what is included by default, otherwise we might try to update that ourselves. All this just seems like a shame how 'locked down' everything appears to be with CentOS/CloudLinux/cPanel, at least if you want things to work reliably and not be broken by future updates. Feeling a bit trapped... Thanks again! 0
Please sign in to leave a comment.
Comments
7 comments