Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

Compile PHP to include WebP functionality for GD

Adam Reece shared this idea 5 years ago
Completed

As a web-development company and hosting provider, we would like PHP supplied by EA4 to include WebP functionality for the GD extension because as a server-side image processor, it ensures that websites can optimize their images on-site for the best page loading speeds.


============


Currently the PHP supplied by EA4 repositories do not include WebP functionality for the GD extension.

This would be of use as a server-side image processor to ensure websites can optimize their images on-site for the best page speeds, given that the image format in many cases offers numerous efficiency improvements compared to rival formats.

PHP's GD extension has supported WebP functionality since version 5.4, though it must be explicitly compiled in to be available. (libvpx for PHP 5.x, libwebp for PHP 7.x)

Original request: https://forums.cpanel.net/threads/update-the-bundled-php-gd-version.657683

Replies (4)

photo
1

If I call imagewebp() right now it works for me! Cpanel PHP 7.3 - PHP FPM

I guess the GD was updated in the meantime, if so this topic could be marked as completed!

photo
1

I am now using PHP 7.4 with EA4, But still i couldn't see Webp support in my phpinfo. Please help

photo
1

WebP support is provided for systems using CentOS 7, CloudLinux 7, RHEL 7, and newer.

photo
1

Why have you had this closed so brashly? Could you please ask for further information first...


Here's part of the packages installed via EA4:

/d242bd09abaf7ce51ac22ff8fad775d6


PHP version is 7.3.11.


Here's the GD section of `php -i`:

gd

GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.3.11
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 6b
PNG Support => enabled
libPNG Version => 1.2.49
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30411
XBM Support => enabled

Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 1 => 1

Calling `imagewebp()` throws an undefined function exception.

Yum shows no packages pending an update, neither does EA4, so if this is implemented there must be an issue delivering it?

photo
1

Dear Adam!

Here is a screenshot of my phpinfo(); GD section

/582621af84bf3b917812145f350769ba


As you can see even if it is the same GD version (Free type is newer) I have WebP enabled.

I dont know how because this is the default for me.

I use Apache with MPM event + PHP 7.3 (also worked for me on php 7.2) + PHP FPM

I tried to look for any php.ini settings but no such setting exist. You got to compile PHP in a certain way to have WebP enabled.

You got to recompile PHP. I recommend first testing it out on a PHP version that you dont use. I found this document for it https://www.php.net/manual/en/image.installation.php

Or if you cant resolve it on your own try opening a support ticket and Cpanel will kindly do it for you.

All best

Zoli

photo
1

Hi Zoli,

That is strange that you've got WebP immediately available. I presume you're using EA4 too?

I'm not sure why we'd need to compile PHP ourselves on each WHM server we have manually. Isn't that the whole point of EasyApache?

photo
1

Yes; I also use EA4

And yes; you are right but least now you see its not a generic problem try Cpanel support

Also I added a feature request for newer GD

https://features.cpanel.net/topic/update-libgd-phps-gd-library-to-newest

photo
1

However libGD is old needs an update

https://github.com/libgd/libgd/releases


I have added a Feature Request for that:

https://features.cpanel.net/topic/update-libgd-phps-gd-library-to-newest

Replies have been locked on this page!