From 7abbfd31420d329079d3c25d724c5c46a1b21e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A8=B1=E7=9B=8A=E9=8A=98?= Date: Fri, 6 May 2022 23:40:14 +0800 Subject: [PATCH] Solved undefined function imagecreatefromjpeg [Solved] `Call to undefined function Intervention\Image\Gd\imagecreatefromjpeg()` [PHP 7.4 Changelog](https://www.php.net/manual/en/migration74.other-changes.php) in GD section we can run docker-php-ext-configure command to configure our gd with JPEG support. we don't need to provide flag to enable PNG. ``` $ docker exec -it laradock_php-worker_1 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] => ) ``` --- php-worker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index ee6d1890..8be39f89 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -87,7 +87,7 @@ ARG INSTALL_GD=false RUN if [ ${INSTALL_GD} = true ]; then \ apk add --update --no-cache freetype-dev libjpeg-turbo-dev jpeg-dev libpng-dev; \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "4" ]; then \ - docker-php-ext-configure gd --with-freetype --with-jpeg --with-png; \ + docker-php-ext-configure gd --with-freetype --with-jpeg; \ else \ docker-php-ext-configure gd --with-freetype-dir=/usr/lib/ --with-jpeg-dir=/usr/lib/ --with-png-dir=/usr/lib/; \ fi; \