How to recompile PHP or change the path to other PHP installation

Keywords: General - AWS - How to - Other
For image optimization, I need WEBP support from GD.
So, I need to recompile the PHP included in the LAMP stack with the support of WEBP in GD.
Or, I need to change the path to PHP to another installation of PHP in the system which supports what I want.
Can someone please explain how to do one or another?

Hi @hkraskian1,

I just launched the latest Bitnami LAMP 7.4 version ( 7.4.19-4) and it has support for WebP

$ php -i | grep "WebP Support"
WebP Support => enabled

If you are using an old version of the solution, you will need to launch a new instance and migrate the data from your current instance to the new one.

Happy to help!

Was my answer helpful? Click on :heart:

Hi @hkraskian1,

In addition to what @jota mentioned above, I checked the value with the phpinfo() and it is also shown as enabled. You can see the related section in the screenshot below

It seems that it’s not true for AWS lightsail bitnami LAMP 7.4

Hi @hkraskian1,

Thanks for letting us know. We released the same LAMP version in all cloud providers, including AWS Lightsail, but it takes usually longer for the Lightsail team to update the solutions in the marketplace while they review them. You can install a more recent Bitnami LAMP stack into your AWS Lightsail machine if you want to. You will need to stop and disable the Bitnami services already running and then run the installer with sudo privileges in order to use ports 80 and 443.

You can download the installer from our official website at

1 Like

Thank you for answer,
May you please give me a link for a detailed description of the proper way of doing it?

I write an answer to help anyone who needs it.
1- create a lightsail LAMP instance.
2- Open it with ssh.
3- cd /opt/bitnami
4- sudo ./ stop.
5- cd /opt
6- upload installer file there.
7- rename /opt/bitnami to /opt/bitnami-bak
8- run the installer
9- choose the LAMP stack folder name to /opt/bitnami.

Hi @hkraskian1,

Thanks for the info. I’m glad you fixed your issue! We will close this thread as solved. Please do not hesitate to open a new one with any other questions you may have.