aaP_ubaidhanif21
In Debian 12 (bookworm), the libwebp6 package has been updated to libwebp7, so it cannot be installed directly.
root@farm:~# apt install libwebp6
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libwebp6
root@farm:~# apt install libwebp7
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libwebp7 is already the newest version (1.2.4-0.2+deb12u1).
libwebp7 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@farm:~#
Install compilation dependencies:
sudo apt install php8.2-dev libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev -y
Recompile the GD extension:
sudo pecl uninstall gd
sudo pecl install gd
Add the extension in the PHP configuration:
echo "extension=gd.so" | sudo tee /etc/php/8.2/fpm/conf.d/30-gd.ini
Restart PHP-FPM:
sudo systemctl restart php8.2-fpm
OR
Create the necessary symbolic links:
sudo ln -s /usr/lib/x86_64-linux-gnu/libwebp.so.7 /usr/lib/x86_64-linux-gnu/libwebp.so.6
sudo ln -s /usr/lib/x86_64-linux-gnu/libwebpdemux.so.2 /usr/lib/x86_64-linux-gnu/libwebpdemux.so.1
sudo ln -s /usr/lib/x86_64-linux-gnu/libwebpmux.so.3 /usr/lib/x86_64-linux-gnu/libwebpmux.so.2
Update the dynamic linker cache:
sudo ldconfig
Verify the links:
ls -l /usr/lib/x86_64-linux-gnu/libwebp*