Php: GD JPEG extension unable to install with PHP 7.4

Created on 1 Dec 2019  路  2Comments  路  Source: docker-library/php

I used to be able to have GD enabled with JPG support in my Dockerfile when my image was based off of php:7.3-fpm-alpine3.10. After upgrading to php:7.4-fpm-alpine3.10, the following line no longer works:

RUN docker-php-ext-configure gd --with-freetype-dir=/usr/lib --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib && \
docker-php-ext-install gd

In PHP 7.4, the configure script gives this error:

configure: WARNING: unrecognized options: --with-freetype-dir, --with-png-dir, --with-jpeg-dir

As a result, once the container is built, JPEG support is not enabled:

# 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] => 
)

Is there a recommended way to configure GD with JPG support on PHP 7.4?

Most helpful comment

912

All 2 comments

912

That did the trick, thanks @phy25 !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nojimage picture nojimage  路  3Comments

ihorsamusenko picture ihorsamusenko  路  4Comments

2Kable picture 2Kable  路  3Comments

ambroisemaupate picture ambroisemaupate  路  3Comments

pukkancs picture pukkancs  路  3Comments