-
Notifications
You must be signed in to change notification settings - Fork 2k
PHP 7.4 - Problems on GD with JPEG and FreeType support #926
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
Comments
https://www.php.net/manual/en/image.installation.php use |
Hi, Im talking about PHP 7.4. It don't have --with-jpeg-dir, i already tried it: Im trying migrate the dockerfile from my project to PHP 7.4. Your way is the old way: This was changed and already talked about it here: There is another thing that don't work in PHP 7.4 GD to support it. |
My latest Dockerfile without success:
I don't understand why it don't compile with correct options. |
The log for command
|
Other problem tips is that file GD.SO is not compiled with jpeg or freetype yet, because it don't have their symbols, only PNG:
|
Hi, I was able to hack and fix it with the following lines:
Basically i call make from GD folder and checked that it has correct flags for jpeg and freetype. After, i copied the generated gd.so to PHP extensions folder. And now the magic:
|
I'm not sure exactly why but the order of installation effects DockerfileFROM php:7.4.0-fpm-buster
MAINTAINER Paulo Coutinho <[email protected]>
######
# You can configure php extensions using docker-php-ext-configure
# You can install php extensions using docker-php-ext-install
######
# define timezone
RUN echo "America/Sao_Paulo" > /etc/timezone
RUN dpkg-reconfigure -f noninteractive tzdata
RUN /bin/echo -e "LANG=\"en_US.UTF-8\"" > /etc/default/local
# install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
libwebp-dev \
curl \
libcurl4 \
libcurl4-openssl-dev \
zlib1g-dev \
libicu-dev \
libmemcached-dev \
memcached \
default-mysql-client \
libmagickwand-dev \
unzip \
libzip-dev \
zip \
nano && \
rm -rf /var/lib/apt/lists/*
# memcached
RUN pecl install memcached-3.1.5
RUN docker-php-ext-enable memcached
# mcrypt
RUN pecl install mcrypt-1.0.3
RUN docker-php-ext-enable mcrypt
# configure, install and enable all php packages, format updated with Tianon's comment below
RUN set -eux; \
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp; \
docker-php-ext-configure intl; \
docker-php-ext-configure mysqli --with-mysqli=mysqlnd; \
docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd; \
docker-php-ext-configure zip; \
docker-php-ext-install -j "$(nproc)" \
gd \
intl \
mysqli \
opcache \
pdo_mysql \
zip
# install xdebug
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_autostart=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.default_enable=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_connect_back=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.profiler_enable=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_log=\"/tmp/xdebug.log\"" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# install imagick
RUN pecl install imagick
RUN docker-php-ext-enable imagick
# install composer
RUN cd /tmp \
&& curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer build$ docker build . -t php:gd
Sending build context to Docker daemon 13.82kB
Step 1/34 : FROM php:7.4.0-fpm-buster
---> 0203f6c79234
Step 2/34 : MAINTAINER Paulo Coutinho <[email protected]>
---> Using cache
---> f0416c7e2c13
Step 3/34 : RUN echo "America/Sao_Paulo" > /etc/timezone
---> Using cache
---> 81b2efe47b09
Step 4/34 : RUN dpkg-reconfigure -f noninteractive tzdata
---> Using cache
---> 989010db1a91
Step 5/34 : RUN /bin/echo -e "LANG=\"en_US.UTF-8\"" > /etc/default/local
---> Using cache
---> 6ae42004ff6c
Step 6/34 : RUN apt-get update && apt-get install -y --no-install-recommends build-essential libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev libwebp-dev curl libcurl4 libcurl4-openssl-dev zlib1g-dev libicu-dev libmemcached-dev memcached default-mysql-client libmagickwand-dev unzip libzip-dev zip nano && rm -rf /var/lib/apt/lists/*
---> Using cache
---> ceb44fc70ab0
Step 7/34 : RUN pecl install memcached-3.1.5
---> Using cache
---> a3df9ec9618a
Step 8/34 : RUN docker-php-ext-enable memcached
---> Using cache
---> 6b9823c098f2
Step 9/34 : RUN pecl install mcrypt-1.0.3
---> Using cache
---> 5afdb1065c94
Step 10/34 : RUN docker-php-ext-enable mcrypt
---> Using cache
---> 32333fa664e4
Step 11/34 : RUN docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp
---> Using cache
---> 2b6129a58a34
Step 12/34 : RUN docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd
---> Using cache
---> 75fa3aa8a478
Step 13/34 : RUN docker-php-ext-configure mysqli --with-mysqli=mysqlnd
---> Using cache
---> b05ca83570bd
Step 14/34 : RUN docker-php-ext-configure intl
---> Using cache
---> 0e99559690e5
Step 15/34 : RUN docker-php-ext-configure zip
---> Using cache
---> 18ff0128468f
Step 16/34 : RUN docker-php-ext-install -j$(nproc) gd
---> Using cache
---> 79565039e24c
Step 17/34 : RUN docker-php-ext-install -j$(nproc) opcache
---> Using cache
---> 903826b99ebe
Step 18/34 : RUN docker-php-ext-install -j$(nproc) pdo_mysql
---> Using cache
---> 5d4abd96554d
Step 19/34 : RUN docker-php-ext-install -j$(nproc) mysqli
---> Using cache
---> 86b0df8b0edc
Step 20/34 : RUN docker-php-ext-install -j$(nproc) intl
---> Using cache
---> 1db646fdea7f
Step 21/34 : RUN docker-php-ext-install -j$(nproc) zip
---> Using cache
---> 6571cab2d25d
Step 22/34 : RUN pecl install xdebug
---> Using cache
---> c2be660325e5
Step 23/34 : RUN docker-php-ext-enable xdebug
---> Using cache
---> 0da2c29166d3
Step 24/34 : RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
---> Using cache
---> f0915cbbfcdb
Step 25/34 : RUN echo "xdebug.remote_autostart=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
---> Using cache
---> 6f3e1b9f5410
Step 26/34 : RUN echo "xdebug.default_enable=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
---> Using cache
---> 55930a6f11ec
Step 27/34 : RUN echo "xdebug.remote_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
---> Using cache
---> 863fda3ad624
Step 28/34 : RUN echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
---> Using cache
---> 6635d8bd4f98
Step 29/34 : RUN echo "xdebug.remote_connect_back=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
---> Using cache
---> 1194e824fb21
Step 30/34 : RUN echo "xdebug.profiler_enable=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
---> Using cache
---> 78b01375d5f4
Step 31/34 : RUN echo "xdebug.remote_log=\"/tmp/xdebug.log\"" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
---> Using cache
---> 02dd6b378527
Step 32/34 : RUN pecl install imagick
---> Using cache
---> 3139cfd7b24d
Step 33/34 : RUN docker-php-ext-enable imagick
---> Using cache
---> 46585c525b84
Step 34/34 : RUN cd /tmp && curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer
---> Using cache
---> eed8993fad91
Successfully built eed8993fad91
Successfully tagged php:gd $ docker run --rm php:gd 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] => 1
[BMP Support] => 1
[TGA Read Support] => 1
[JIS-mapped Japanese Font Support] =>
) Also the |
Hi, Yes, changing the order make compilation works too. Thanks. |
Closing, seems to be resolved. |
Yes, was resolved, changing the order too. Thanks. |
Moving GD to the top fixed my issue too , is this a bug in docker php extension installer script? |
I thought this was odd, but had an epiphany this morning -- it's not a "bug" of Line 123 in 098e442
When it finishes working, # configure, install and enable all php packages
RUN set -eux; \
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp; \
docker-php-ext-configure intl; \
docker-php-ext-configure mysqli --with-mysqli=mysqlnd; \
docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd; \
docker-php-ext-configure zip; \
docker-php-ext-install -j "$(nproc)" \
gd \
intl \
mysqli \
opcache \
pdo_mysql \
zip |
Hi,
Im trying use PHP 7.4 with GD with JPEG and FreeType support. But i don't know why it is not enabled. Code:
My Dockerfile:
Can anyone help me?
The text was updated successfully, but these errors were encountered: