Author Topic: How to compile PHP with support for webp in gd?  (Read 30809 times)

0 Members and 1 Guest are viewing this topic.

Offline
**
How to compile PHP with support for webp in gd?
« on: June 03, 2019, 08:18:26 PM »
I'v already installed it using:
Code: [Select]
yum install libwebp-develBut how can I compile php-fpm with it?

Offline
**
Re: How to compile PHP with support for webp in gd?
« Reply #1 on: June 05, 2019, 05:40:53 PM »
I really need to know how to have webp support with gd extension. please!

Offline
**
Re: How to compile PHP with support for webp in gd?
« Reply #2 on: June 05, 2019, 08:06:50 PM »
What do you mean support it? Do you mean to convert images or support displaying them on a website?

Offline
**
Re: How to compile PHP with support for webp in gd?
« Reply #3 on: June 05, 2019, 11:31:53 PM »
What is the particular extension you want to enable in php?

Offline
**
Re: How to compile PHP with support for webp in gd?
« Reply #4 on: June 06, 2019, 02:31:07 AM »
Guys,


I'm hosting Wordpress sites, and recently there are plugins like "Webp express" that can convert standard images (like jpg, png) to webp format for better loading times.


When installing webp express plugin, I'm shown none of the possibilites to convert the images are available, as can be seen here:
https://pasteboard.co/Ii5Nbkt.jpg


I've tried the same plugin on another server I have, running on ispconfig (which I consider as much more primitive comparing to CWP), and there it supports gd out of the box.


So yeah... I'm looking for a way to add --with-webp to the php compiler (it's possible to add such options in php selector, but I don't think it influences php-fpm which I'm using).


Here's a reference to PHP's manual:
https://www.php.net/manual/en/function.imagewebp.php

Offline
*
Re: How to compile PHP with support for webp in gd?
« Reply #5 on: June 09, 2019, 09:31:44 AM »
hi
how enable wepb support in php?
gd -> WebP Support -> enabled

Offline
*
Re: How to compile PHP with support for webp in gd?
« Reply #6 on: June 09, 2019, 01:38:31 PM »
it looks php-fpm not have webp
how  enable it?

Offline
*
Re: How to compile PHP with support for webp in gd?
« Reply #7 on: June 10, 2019, 09:57:37 AM »
here is solution
1 install libwebp
2 edit php config build file /usr/local/cwpsrv/htdocs/resources/conf/php-fpm_selector/7.1.ini  or use any php version
3 add in bottom
Code: [Select]
[webp]
default=1
option="--with-webp-dir=/usr/lib64/"
4 rebuild php

Offline
**
Re: How to compile PHP with support for webp in gd?
« Reply #8 on: June 10, 2019, 07:07:36 PM »
here is solution
1 install libwebp
2 edit php config build file /usr/local/cwpsrv/htdocs/resources/conf/php-fpm_selector/7.1.ini  or use any php version
3 add in bottom
Code: [Select]
[webp]
default=1
option="--with-webp-dir=/usr/lib64/"
4 rebuild php

Thank you, but unfortunately, it's not working (already compiled twice).



« Last Edit: June 10, 2019, 07:14:32 PM by ring_c »

Offline
**
Re: How to compile PHP with support for webp in gd?
« Reply #9 on: June 17, 2019, 08:31:24 PM »
So? Can't anyone figure this out? Please?!

Offline
**
Re: How to compile PHP with support for webp in gd?
« Reply #10 on: June 22, 2019, 06:44:27 PM »
This one kills me... Why can't we get instructions on how to compile PHP with WEBP support?!

Offline
*
Re: How to compile PHP with support for webp in gd?
« Reply #11 on: June 22, 2019, 07:47:52 PM »
Hey ring,

I know this isnt the answer but I am using the ShortPixel Adaptive Image plugin on all my wordpress sites and they are being served as webp. AppSumo had a great deal for them recently and I purchased a couple of codes for it but when I checked today, the deal had expired. I believe they have a free version but not sure if you would be able to auto use their CDN.

Offline
**
Re: How to compile PHP with support for webp in gd?
« Reply #12 on: June 23, 2019, 05:43:16 AM »
Hey ring,

I know this isnt the answer but I am using the ShortPixel Adaptive Image plugin on all my wordpress sites and they are being served as webp. AppSumo had a great deal for them recently and I purchased a couple of codes for it but when I checked today, the deal had expired. I believe they have a free version but not sure if you would be able to auto use their CDN.
Funny, that's exactly why I'm asking for webp support. I bought this great deal from AppSumo as well, and although I've marked in its settings to use webp, I'm still getting JPGs. I thought it had to do with my setup.
But coming to think about it, as they're being served from their CDN, why would I still get JPGs? Weird...


But anyway, I host other sites for my clients, and I would like to support WebP for them.

Offline
*
Re: How to compile PHP with support for webp in gd?
« Reply #13 on: July 14, 2019, 06:05:53 PM »
This works for me.
As ed44rf write above,
1. install libwebp
2. edit PHP config build file /usr/local/cwpsrv/htdocs/resources/conf/php-fpm_selector/7.1.ini  or use any PHP version
3. Add this somewhere after [gd-...]

[gd-webp]
default="1"
option="--with-webp-dir=/usr --enable-gd-webp"
info-file="gd.txt"

4 rebuild php

Offline
*
Re: How to compile PHP with support for webp in gd?
« Reply #14 on: July 15, 2019, 01:13:13 AM »
Hey ring,

I know this isnt the answer but I am using the ShortPixel Adaptive Image plugin on all my wordpress sites and they are being served as webp. AppSumo had a great deal for them recently and I purchased a couple of codes for it but when I checked today, the deal had expired. I believe they have a free version but not sure if you would be able to auto use their CDN.
Funny, that's exactly why I'm asking for webp support. I bought this great deal from AppSumo as well, and although I've marked in its settings to use webp, I'm still getting JPGs. I thought it had to do with my setup.
But coming to think about it, as they're being served from their CDN, why would I still get JPGs? Weird...


But anyway, I host other sites for my clients, and I would like to support WebP for them.

Sorry for getting back to you so late. When I right click one of the images and open in a new tab it will look something like this:
Code: [Select]
https://cdn.shortpixel.ai/spai/w_535+q_lossy+ret_img+to_webp/https://3rdcoastdomains.net/wp-content/uploads/1X_Hosting_Illustration_01.png
At first I was thinking it was still in .png format but when you right click the image and save image as it will show as:
Code: [Select]
1X_Hosting_Illustration_01.webp
Is that what you were seeing?