Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update GD version to support Webp for PHP 7.3

Tags:

php

cpanel

whm

I am trying to enable WebP support for GD through WHM.

Currently I am getting version 2.1.0 (2.5.5 is stable) and when I check PHP info WebP support is not enabled.

Can I enable this using WHM?

I am not experienced with servers and I am using WHM settings.

like image 272
flinch85 Avatar asked Dec 12 '25 19:12

flinch85


2 Answers

PHP needs to be compiled to support it.

To enable support for webp add --with-vpx-dir=DIR . Available as of PHP 5.4.0. As of PHP 7.0.0 --with-webp-dir=DIR has to be added, i.e. support for libvpx has been removed in favor of libwebp.

https://www.php.net/manual/en/image.installation.php

Of course, your server will also need either libvpx or libwebp installed.

like image 139
delboy1978uk Avatar answered Dec 14 '25 08:12

delboy1978uk


Instead of recompiling PHP, you can use the official WebP package to generate WebP images. Just download the package depending on your server OS. Extract it and upload it to public_html folder. Using shell_exec command you can generate WebP images from png, jpg etc. No root access or package needs to install. For more information follow the tutorial on enable-webp-support-php-7. Hope it help.

like image 30
Code Book Avatar answered Dec 14 '25 09:12

Code Book



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!