Update GD version to support Webp for PHP 7.3

懵懂的女人 提交于 2021-01-28 11:19:06

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/60340713/update-gd-version-to-support-webp-for-php-7-3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!