Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gd has unrecognized options in PHP 7.4 #912

Closed
patrickomeara opened this issue Nov 30, 2019 · 8 comments
Closed

gd has unrecognized options in PHP 7.4 #912

patrickomeara opened this issue Nov 30, 2019 · 8 comments

Comments

@patrickomeara
Copy link
Contributor

patrickomeara commented Nov 30, 2019

During an upgrade to PHP 7.4 I can't specify options to docker-php-ext-configure

test Dockerfile below

FROM php:7.4.0-apache

# packages
RUN apt-get update \
  && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
  # needed for gd
  libfreetype6-dev \
  libjpeg62-turbo-dev \
  libpng-dev \
  && rm -rf /var/lib/apt/lists/*

# GD
RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr \
  && docker-php-ext-install -j "$(nproc)" gd

RUN php -r 'var_dump(gd_info());'

output from step 3

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

output from step 4

array(13) {
  ["GD Version"]=>
  string(26) "bundled (2.1.0 compatible)"
  ["FreeType Support"]=>
  bool(false)
  ["GIF Read Support"]=>
  bool(true)
  ["GIF Create Support"]=>
  bool(true)
  ["JPEG Support"]=>
  bool(false)
  ["PNG Support"]=>
  bool(true)
  ["WBMP Support"]=>
  bool(true)
  ["XPM Support"]=>
  bool(false)
  ["XBM Support"]=>
  bool(true)
  ["WebP Support"]=>
  bool(false)
  ["BMP Support"]=>
  bool(true)
  ["TGA Read Support"]=>
  bool(true)
  ["JIS-mapped Japanese Font Support"]=>
  bool(false)
}
@patrickomeara
Copy link
Contributor Author

swapping the base image to php:7.3-apache

no error from docker-php-ext-configure

output from step 4

array(13) {
  ["GD Version"]=>
  string(26) "bundled (2.1.0 compatible)"
  ["FreeType Support"]=>
  bool(true)
  ["FreeType Linkage"]=>
  string(13) "with freetype"
  ["GIF Read Support"]=>
  bool(true)
  ["GIF Create Support"]=>
  bool(true)
  ["JPEG Support"]=>
  bool(true)
  ["PNG Support"]=>
  bool(true)
  ["WBMP Support"]=>
  bool(true)
  ["XPM Support"]=>
  bool(false)
  ["XBM Support"]=>
  bool(true)
  ["WebP Support"]=>
  bool(false)
  ["BMP Support"]=>
  bool(true)
  ["JIS-mapped Japanese Font Support"]=>
  bool(false)
}

Has there been an undocumented change to docker-php-ext-configure in 7.4?

@richardbrinkman
Copy link

richardbrinkman commented Nov 30, 2019

I came accross the same issue. I could repair it by changing the line

docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr

into

docker-php-ext-configure gd --with-freetype --with-jpeg

I could not find a --with-png option, but png resizing worked in my case. So maybe png support is a built in default as of PHP 7.4.

A further change I had to make was to include the libonig-dev apt package in order to compile the pdo module.

It's strange that the README.md and the description on Docker Hub don't give examples how to compile pdo and gd properly on PHP 7.4, but only give it for PHP 7.2 (which still works for 7.3 as well).

@patrickomeara
Copy link
Contributor Author

That has indeed fixed the issue. Thanks @richardbrinkman

@JoelLinn
Copy link

This is a change by PHP in Version 7.4
#910 (comment)

@patrickomeara
Copy link
Contributor Author

Thanks @JoelLinn

meezaan pushed a commit to islamic-network/php74 that referenced this issue Dec 17, 2019
WyriHaximus added a commit to WyriHaximusNet/docker-php that referenced this issue Dec 24, 2019
WyriHaximus added a commit to WyriHaximusNet/docker-php that referenced this issue Dec 24, 2019
Toilal added a commit to inetum-orleans/generator-docker-devbox that referenced this issue Dec 30, 2019
Toilal added a commit to inetum-orleans/generator-docker-devbox that referenced this issue Dec 30, 2019
LucaGallinari added a commit to webgriffe/docker-php-ci-image that referenced this issue Jan 27, 2020
@llslim
Copy link

llslim commented Feb 1, 2020

The GD options changed by using pkg-config is explained in the upgrading document
pkg-config option changes to GD Extension

Also the upgrading document mentions in the changes to the MBSTRING extension, the following:

  • Mbstring:
    . The oniguruma library is no longer bundled with PHP, instead libonig needs
    to be available on the system. Alternatively --disable-mbregex can be used
    to disable the mbregex component.

For those building off of Debian flavored images use (libonig-devel). I found it useful to put the library in my build dependencies with the libpng library

alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Nov 1, 2022
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Nov 4, 2022
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Nov 6, 2022
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Nov 9, 2022
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Nov 11, 2022
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Nov 18, 2022
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Nov 19, 2022
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Dec 14, 2022
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Dec 20, 2022
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Dec 21, 2022
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Dec 23, 2022
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Jan 2, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Jan 22, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Jan 28, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Feb 4, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Feb 11, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Feb 20, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Feb 27, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Feb 28, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Mar 1, 2023
julia-bauder added a commit to DigitalGrinnell/omeka-s-docker that referenced this issue Mar 20, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Mar 20, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Mar 28, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Apr 16, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue May 19, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Jun 19, 2023
alaincao pushed a commit to SigmaConso/PrivateBin that referenced this issue Jul 6, 2023
@dvphucsgt
Copy link

Thanks @richardbrinkman

@olegabr
Copy link

olegabr commented Oct 13, 2023

PHP 7.4 and above

FROM wordpress:php7.4
RUN apt-get update && apt-get install -y \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    libwebp-dev \
    libxpm-dev \
    zlib1g-dev && \
    docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg \
    --with-xpm --with-freetype && \
    docker-php-ext-install -j$(nproc) gd && \
    rm -rf /var/lib/apt/lists/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants