I'm working with php 7.4.10 version on Red Hat Linux 86_64 server and i would like to convert all images automatically to webp extension after user upload an image. I have php code that works fine to upload image, but when i try to upload an image i get the error below:
Fatal error: Uncaught Error: Call to undefined function imagewebp() in....
When i got that error above, i typed var_dump (gd_info()) on page and after this i got these informations below:
array(14) {
["GD Version"]=> string(26) "bundled (2.1.0 compatible)"
["FreeType Support"]=> bool(true)
["FreeType Linkage"]=> string(13) "with freetype"
["GIF Read Support"]=> bool(true)
["GIF Create Support"]=> bool(true)
["JPEG Support"]=> bool(true)
["PNG Support"]=> bool(true)
["WBMP Support"]=> bool(true)
["XPM Support"]=> bool(true)
["XBM Support"]=> bool(true)
["WebP Support"]=> bool(false)
["BMP Support"]=> bool(true)
["TGA Read Support"]=> bool(true)
["JIS-mapped Japanese Font Support"]=> bool(false)
}
Based on array result above, the Webp support is checked as false:
["WebP Support"]=> bool(false)
In this case how could i enable WebP Support as ["WebP Support"]=> bool(true)? I found some similar questions related to my doubt:
- Update GD version to support Webp for PHP 7.3
- How to compile php to enable webp support?
- Enabling WebP Support in GD Library on Ubuntu 18.04 running on LiteSpeed
but unfortunatly i didn't find a correct way to enable webp support on my server.