wget https://www.php.net/distributions/php-7.4.28.tar.bz2 tar xf php-7.4.28.tar.bz2 cd php-7.4.28 cd ext/gd/ phpize ## Run the actual configure ./configure --with-php-config=/usr/local/php/bin/php-config --with-gd --enable-gd --with-jpeg=/usr/include --with-webp=/usr/include/webp
make && make install ## Copy new gd.so file in place, backup old one cp /usr/lib64/php/modules/gd.so ~/gd.so.bak cp /var/www/php-7.4.28/ext/gd/modules/gd.so /usr/lib64/php/modules/gd.so # Right after, otherwise server goes down. sudo service httpd restart # Check if WebP support is enabled: php -r "print_r( gd_info() );"