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

In php:7.4.1-apache, Error: unrecognized options: --with-png-dir, --with-jpeg-dir, --with-freetype-dir #931

Closed
antunesgabriel opened this issue Dec 23, 2019 · 4 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@antunesgabriel
Copy link

Problem

I'm trying to upload a container with php: 7.4.1-apache, but I'm getting the error:

configure: error: unrecognized options: --with-png-dir, --with-jpeg-dir, --with-freetype-dir
ERROR: Service 'php' failed to build: The command '/bin/sh -c docker-php-ext-configure gd   --with-png-dir=/usr/include/   --with-jpeg-dir=/usr/include/   --with-freetype-dir=/usr/include/' returned a non-zero code: 1

My Dockerfile

FROM php:7.4.1-apache

RUN apt-get update && apt-get install -y --no-install-recommends \
  autoconf \
  build-essential \
  apt-utils \
  zlib1g-dev \
  libzip-dev \
  unzip \
  zip \
  libmagick++-dev \
  libmagickwand-dev \
  libpq-dev \
  libfreetype6-dev \
  libjpeg62-turbo-dev \
  libpng-dev \
  libwebp-dev \ 
  libxpm-dev 

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

RUN docker-php-ext-configure zip --with-libzip

RUN docker-php-ext-install gd intl pdo_mysql pdo_pgsql mysqli zip

RUN pecl install imagick-3.4.3

RUN pecl install xdebug && docker-php-ext-enable xdebug

RUN docker-php-ext-enable imagick

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Clear package lists
RUN apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

# Permissions
RUN chown -R root:www-data /var/www/html
RUN chmod u+rwx,g+rx,o+rx /var/www/html
RUN find /var/www/html -type d -exec chmod u+rwx,g+rx,o+rx {} +
RUN find /var/www/html -type f -exec chmod u+rw,g+rw,o+r {} +

WORKDIR /var/www/html

RUN a2enmod rewrite
RUN a2enmod ssl

EXPOSE 80
EXPOSE 443

In image php:7.3.7-apache it works, but in php:7.4-apache and php:7.4.1-apache it doesn't work :(

@phy25
Copy link

phy25 commented Dec 23, 2019

Have you seen #912?

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Dec 23, 2019
@opsnoopop
Copy link

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

New
RUN docker-php-ext-configure gd
--with-png=/usr/include/
--with-jpeg=/usr/include/
--with-freetype=/usr/include/

@VladimirAus
Copy link

--with-png does not exists anymore but apparently works according to #912 (comment)

@yosifkit
Copy link
Member

yosifkit commented Jan 1, 2020

Closing; duplicate #912.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

6 participants