gd

Centos 6.9 PHP 7.4.19 gd jpeg ispmanager

Основная проблема, что поставляемая версия PHP 7.4.19 не поддерживает jpeg

/opt/php74/bin/php -r 'print_r(gd_info());'
Array
(
[GD Version] => bundled (2.1.0 compatible)
[FreeType Support] => 1
[FreeType Linkage] => with freetype
[GIF Read Support] => 1
[GIF Create Support] => 1
[JPEG Support] =>
[PNG Support] => 1
[WBMP Support] => 1
[XPM Support] => 1
[XBM Support] => 1
[WebP Support] => 1
[BMP Support] => 1
[TGA Read Support] => 1
[JIS-mapped Japanese Font Support] =>
)

Для сборки библиотеки использовался образ Centos 6.9 в который скопирована папка с сервера /etc/yum.repos.d

Далее

yum install isp-php74.x86_64 libwebp-devel.x86_64 cmake —nogpgcheck -y
wget https://deac-ams.dl.sourceforge.net/project/libjpeg-turbo/2.1.0/libjpeg-turbo-2.1.0.tar.gz
tar zxf libjpeg-turbo-2.1.0.tar.gz
cd libjpeg-turbo-2.1.0
cmake -G"Unix Makefiles"
make
wget https://www.php.net/distributions/php-7.4.19.tar.gz
tar zxf php-7.4.19.tar.gz
cd php-7.4.19/ext/gd
phpize
aclocal && autoreconf -f
./configure PKG_CONFIG_PATH=»/root/libjpeg-turbo-2.1.0/pkgscripts/:/usr/lib64/pkgconfig/:/usr/share/pkgconfig/» ZLIB_CFLAGS=» » ZLIB_LIBS=»-lz» —with-jpeg —with-freetype —with-xpm —with-webp —enable-gd —with-php-config=/opt/php74/bin/php-config
make
Далее из php-7.4.19/ext/gd/modules копируем gd.so на сервер в /opt/php74/lib/php/modules предварительно сохранив старую версию
/opt/php74/bin/php -r 'print_r(gd_info());'
Array
(
    [GD Version] => bundled (2.1.0 compatible)
    [FreeType Support] => 1
    [FreeType Linkage] => with freetype
    [GIF Read Support] => 1
    [GIF Create Support] => 1
    [JPEG Support] => 1
    [PNG Support] => 1
    [WBMP Support] => 1
    [XPM Support] => 1
    [XBM Support] => 1
    [WebP Support] => 1
    [BMP Support] => 1
    [TGA Read Support] => 1
    [JIS-mapped Japanese Font Support] =>
)