I tried enabling GD JPEG with DOCKER but it doesn't work. This is my dockerfile :
FROM php:7.4-apache
COPY ./app/. /var/www/html
RUN apt-get update && apt-get install -y \
libzip-dev zip \
zlib1g-dev \
libjpeg-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
libpng-dev
RUN docker-php-ext-install mysqli && a2enmod rewrite && service apache2 restart && chown -R www-data:www-data /var/www
RUN docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg
RUN docker-php-ext-install zip && docker-php-ext-install -j$(nproc) gd
But the result remains the same:
# php -r "print_r(gd_info());"
Array
(
[GD Version] => bundled (2.1.0 compatible)
[FreeType Support] =>
[GIF Read Support] => 1
[GIF Create Support] => 1
[JPEG Support] =>
[PNG Support] => 1
[WBMP Support] => 1
[XPM Support] =>
[XBM Support] => 1
[WebP Support] =>
[BMP Support] => 1
[TGA Read Support] => 1
[JIS-mapped Japanese Font Support] =>
)
JPEG Support is still false.
Try installing the extensions [step 5/5] with a single execution of a docker-php-ext-install, just append to the end:
RUN docker-php-ext-install -j$(nproc) gd zip
result:
root@b83821be0bcf:/var/www/html# 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] =>
[XBM Support] => 1
[WebP Support] =>
[BMP Support] => 1
[TGA Read Support] => 1
[JIS-mapped Japanese Font Support] =>
)
root@b83821be0bcf:/var/www/html#
Read this bug for details.
I have the same problem for PHP 7.4 in docker and spent a lot of hours looking for a solution.
The only one worked with me is:
$ wget http://www.ijg.org/files/jpegsrc.v9.tar.gz
$ tar xvfz jpegsrc.v9.tar.gz
$ cd jpeg-9
$ ./configure
$ make
$ make install
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg=/usr/local/lib
$ docker-php-ext-install gd
References:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With