How to Compile the GD PHP Extension
Sometimes the lsphp-gd package is not up-to-date, in which case it may be missing some features, like WebP support. If this happens, you can manually compile the GD extension to include the new features.
Install Dependencies
yum install -y lsphp73-devel gcc libjpeg-turbo-devel libpng-devel libXpm-devel freetype-devel libwebp-devel
Download the PHP Source Code
In this example we use lsphp73
. Please change it to another appropriate PHP version number if necessary.
wget https://www.php.net/distributions/php-7.3.12.tar.gz tar xzvf php-7.3.12.tar.gz cd php-7.3.12 cd ext cd gd /usr/local/lsws/lsphp73/bin/phpize ./configure --with-php-config=/usr/local/lsws/lsphp73/bin/php-config --with-webp-dir=/usr/include/webp --with-freetype-dir=/usr/include/freetype2/freetype --with-jpeg-dir=/usr/include --with-png-dir=/usr/include --with-xpm-dir=/usr/include make make install