Add WebP support to GD (PHP Module)

BoxMan

Registered
Aug 9, 2016
4
1
3
UAE
cPanel Access Level
Root Administrator
In order to clarify the issue I don't have any problem with install PHP with GD enabled but when I want to use imagewebp() I got an error:

Code:
Fatal error: Call to undefined function imagewebp()
After searching about the error I find the problem. I need to install GD --with-vpx-dir=DIR as I see in PHP.net: GD Installing/Configuring

I know EasyApache will search for additional GD feature libraries (PHP Module: GD):
  • JPEG support > if find > libjpeg.so
  • PNG support > if find > libpng.so
  • XPM support > if find > libXpm.so
But what about WebP? is this something like this:
  • WebP support > if find > libvpx.so
I installed libvpx & libvpx-devel and after that I find libvpx.so as same path as libXpm.so and other *.so than I rebuild EasyApache and I expected see --with-vpx-dir=DIR in my phpinfo()
configure command section, but nothing different and if I use imagewebp() got the error.

Where am I wrong? and how to enable imagewebp() on my server (CentOS 7 - 64bit).
 

BoxMan

Registered
Aug 9, 2016
4
1
3
UAE
cPanel Access Level
Root Administrator
Thanks for useful link.

I use EasyApache 3 and PHP 5. So I must create file:

Code:
/var/cpanel/easy/apache/rawopts/all_php5
with this content:

Code:
--with-vpx-dir
--path-to-vpx-dir=/usr/lib64/libvpx.so
--my-option=

--with-webp-dir
--path-to-webp-dir=/usr/lib64/libwebp.so
--my-option=
And than rebuild, is it true?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
--with-vpx-dir
--path-to-vpx-dir=/usr/lib64/libvpx.so
--my-option=

--with-webp-dir
--path-to-webp-dir=/usr/lib64/libwebp.so
--my-option=
Hello,

Try using the following entries before running EasyApache again and let us know if it makes a difference:

Code:
--with-vpx-dir=/usr
--with-webp-dir=/usr
Thank you.