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

Install error "Unterminated preprocessor conditions" in php 8.3 #640

Open
FedericoHeichou opened this issue Nov 24, 2023 · 51 comments
Open

Comments

@FedericoHeichou
Copy link

The first if condition in Imagick.stub.php is not closed

class Imagick
{
#if MagickLibVersion > 0x628
public function optimizeImageLayers(): bool {}

This causes a installation error "Unterminated preprocessor conditions" in PHP 8.3

I'll submit a PR

@dinamic
Copy link

dinamic commented Jan 15, 2024

Just had the same issue happening. Here are steps to reproduce:

docker run -it --rm php:8.3-alpine sh
apk update
apk add imagemagick imagemagick-dev gcc make autoconf g++ 
pecl install imagick

@UtkuDalmaz
Copy link

Any solution?

@dinamic
Copy link

dinamic commented Feb 5, 2024

@UtkuDalmaz People have tried to get in touch with the maintainer over different communication channels to no avail. I'm sticking with PHP 8.2 for now. Have a look at the discussion here: #641

@Danack
Copy link
Collaborator

Danack commented Feb 8, 2024

Thanks. It should be fixed now in develop, but as it never seemed to be a problem on my machine, I can't guarantee that.

I've actually just removed the #if MagickLibVersion > 0x628 as the minimum version of ImageMagick is above that now.

I'll close this issue when I'm more confident it's fixed (aka github actions are passing), but that will require more poking and possibly dropping support for PHP < 7.0 as the gen_stubs.php tool seems to no longer support those. Probably appropriately.

@dinamic
Copy link

dinamic commented Feb 8, 2024

@Danack so happy to hear from you! I hope things are okay.

The issue is easily reproducible with a docker container:

docker run -it --rm php:8.3-alpine sh
apk update
apk add imagemagick imagemagick-dev gcc make autoconf g++ 
pecl install imagick

@tcubukcu
Copy link

@UtkuDalmaz People have tried to get in touch with the maintainer over different communication channels to no avail. I'm sticking with PHP 8.2 for now. Have a look at the discussion here: #641

Yes using php8.2 seems like the best solution for now. I tried it on version 8.2, there was no problem with the installation.

@ihabzee
Copy link

ihabzee commented Mar 7, 2024

any update on when this issue will be fixed?
Thanks!

@mashb1t
Copy link

mashb1t commented Mar 8, 2024

having the same issue in PHP 8.3 (running on M1/arm and Docker)

admdly added a commit to admdly/FOSSBilling that referenced this issue Mar 13, 2024
Remove `imagick` dependency from Docker image as not strictly required (dompdf/dompdf#3376) and to resolve issue with PHP 8.3 (Imagick/imagick#640).
BelleNottelling pushed a commit to FOSSBilling/FOSSBilling that referenced this issue Mar 13, 2024
* Remove Docker image imagick dependency

Remove `imagick` dependency from Docker image as not strictly required (dompdf/dompdf#3376) and to resolve issue with PHP 8.3 (Imagick/imagick#640).

* Update Docker image to PHP 8.3

* Move GD to required PHP extensions
@ricardomecca
Copy link

Not have updates?
I've been waiting for the PECL update with the correction for more than 3 months but so far nothing.

@pF-luis
Copy link

pF-luis commented Apr 3, 2024

Same issue here

@mathroc
Copy link

mathroc commented Apr 3, 2024

A small recap: the issue is fixed on develop but a new tag for this hasn't been published yet. The maintainers are aware of this. Meanwhile, it means your choices are:

  • use develop instead of a tagged version
  • keep using PHP 8.2
  • fork the extension and tag a release of your own

You can also subscribe to this issue notifications, someone will very likely announce it here when a new tag appears.

But it's not very useful to post comment to "+1" the issue, complain or ask for estimates on when this will happen

@pF-luis
Copy link

pF-luis commented Apr 3, 2024

It's a simple comment, no harm done 😘 Thanks for the recap tho, thought something might've happened since the last official info was about two month ago.

@yesidevelop
Copy link

Sometimes it works, sometimes it doesn't strange bug
I tried this way
RUN pecl install imagick
RUN docker-php-ext-enable imagick

kpine added a commit to kpine/docker-webtrees that referenced this issue Apr 12, 2024
Imagick Fails when using `--no-cache --ci`: Imagick/imagick#640
@renky
Copy link

renky commented Apr 25, 2024

For everybody who is using mlocati/php-extension-installer

RUN install-php-extensions imagick/imagick@master

nevertheless: it's only a workarround in my opinion.
It's now more than two months ago that I had a last look on this issue and in all projects where I used imagick I finally could switch to gd or gmagick without any problems when upgrading to PHP8.3... Until today - now I have a project where I have to stick with imagick and I just see: still the same issue...

I know - the solution above works. But sorry... for productive environments I don't see an untagged version as a stable solution - in a production environment I need deterministic build processes and installation behavior and for that it is indispensable to have a tagged version of all dependencies... Just for a shortime workaround, I would accept such a develop solution.

If this extension cannot ensure this any more, I guess it's really EOL because more and more people will switch. That's why I again suggest to share responsibility for such an important php extension. It's also an option to contact the php foundation to request about helping in maintaining. Maybe the interest is high enough in case of this extension.

On the other side: Where is the problem to just put a tag on it?

Thanks to everybody who is working on it.

@eminozlem
Copy link

bumping for visibility. I am waiting for imagick to upgrade my websites to php 8.3. Hope this gets resolved soon 🙏

WHM OS
AlmaLinux v8.9.0

@thdebay
Copy link

thdebay commented Aug 10, 2024

Has anyone succeeded in installing the imagick-php extension with the manual installation method?

I'm grateful for the suggestions that were suggested earlier, thanks to these I've been able to add Imagick to my Alpine image, however it seems the PDF documents cannot be processed (even though GS is installed).

Has anyone encountered the same issue with these alternative installation methods?

RUN set -eux; \
	apk add --no-cache imagemagick-dev ghostscript; \
	curl -fL -o imagick.tgz 'https://pecl.php.net/get/imagick-3.7.0.tgz'; \
	echo '5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e *imagick.tgz' | sha256sum -c -; \
	tar --extract --directory /tmp --file imagick.tgz imagick-3.7.0; \
	grep '^//#endif$' /tmp/imagick-3.7.0/Imagick.stub.php; \
	test "$(grep -c '^//#endif$' /tmp/imagick-3.7.0/Imagick.stub.php)" = '1'; \
	sed -i -e 's!^//#endif$!#endif!' /tmp/imagick-3.7.0/Imagick.stub.php; \
	grep '^//#endif$' /tmp/imagick-3.7.0/Imagick.stub.php && exit 1 || :; \
	docker-php-ext-install /tmp/imagick-3.7.0; \
	rm -rf imagick.tgz /tmp/imagick-3.7.0

@ErroneousBosch
Copy link

@dinamic

Tested this and it built fine with your commands on a fresh pull of the php:8.3-alpine image.

$ docker run -it --rm php:8.3-alpine sh
Unable to find image 'php:8.3-alpine' locally
8.3-alpine: Pulling from library/php
c6a83fedfae6: Pull complete 
3ae0d9dfc4da: Pull complete 
ce295ca8623e: Pull complete 
60d3eb99f3c1: Pull complete 
6a875e60b20d: Pull complete 
494e33775149: Pull complete 
456a98184ff4: Pull complete 
ce6e3dc3f7c5: Pull complete 
81af22c0eb61: Pull complete 
Digest: sha256:cada46505b6cd62d318aa9ef1fe834fed1cd3ac4a1422bd7158095f53fc7c036
Status: Downloaded newer image for php:8.3-alpine
/ # apk update
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz
v3.20.2-111-g828f1357895 [https://dl-cdn.alpinelinux.org/alpine/v3.20/main]
v3.20.2-125-g535b7c8b1d5 [https://dl-cdn.alpinelinux.org/alpine/v3.20/community]
OK: 24163 distinct packages available
/ # apk add imagemagick imagemagick-dev gcc make autoconf g++ 
(1/37) Installing m4 (1.4.19-r3)
(2/37) Installing libbz2 (1.0.8-r6)
(3/37) Installing perl (5.38.2-r0)
(4/37) Installing autoconf (2.72-r0)
(5/37) Installing libstdc++ (13.2.1_git20240309-r0)
(6/37) Installing libstdc++-dev (13.2.1_git20240309-r0)
(7/37) Installing jansson (2.14-r4)
(8/37) Installing binutils (2.42-r0)
(9/37) Installing libgomp (13.2.1_git20240309-r0)
(10/37) Installing libatomic (13.2.1_git20240309-r0)
(11/37) Installing gmp (6.3.0-r1)
(12/37) Installing isl26 (0.26-r1)
(13/37) Installing mpfr4 (4.2.1-r0)
(14/37) Installing mpc1 (1.3.1-r1)
(15/37) Installing gcc (13.2.1_git20240309-r0)
(16/37) Installing musl-dev (1.2.5-r0)
(17/37) Installing g++ (13.2.1_git20240309-r0)
(18/37) Installing libxau (1.0.11-r4)
(19/37) Installing libmd (1.1.0-r0)
(20/37) Installing libbsd (0.12.2-r0)
(21/37) Installing libxdmcp (1.1.5-r1)
(22/37) Installing libxcb (1.16.1-r0)
(23/37) Installing libx11 (1.8.9-r1)
(24/37) Installing libxext (1.3.6-r2)
(25/37) Installing fftw-double-libs (3.3.10-r5)
(26/37) Installing libexpat (2.6.2-r0)
(27/37) Installing libpng (1.6.43-r0)
(28/37) Installing freetype (2.13.2-r0)
(29/37) Installing fontconfig (2.15.0-r1)
(30/37) Installing lcms2 (2.16-r0)
(31/37) Installing libltdl (2.4.7-r3)
(32/37) Installing imagemagick-libs (7.1.1.32-r2)
(33/37) Installing imagemagick (7.1.1.32-r2)
(34/37) Installing imagemagick-c++ (7.1.1.32-r2)
(35/37) Installing pkgconf (2.2.0-r0)
(36/37) Installing imagemagick-dev (7.1.1.32-r2)
(37/37) Installing make (4.4.1-r2)
Executing busybox-1.36.1-r29.trigger
OK: 288 MiB in 76 packages
/ # pecl install imagick
downloading imagick-3.7.0.tgz ...
Starting to download imagick-3.7.0.tgz (360,138 bytes)
.........................................................................done: 360,138 bytes
33 source files, building
running: phpize
Configuring for:
PHP Api Version:         20230831
Zend Module Api No:      20230831
Zend Extension Api No:   420230831
Please provide the prefix of ImageMagick installation [autodetect] : 
building in /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0
running: /tmp/pear/temp/imagick/configure --with-php-config=/usr/local/bin/php-config --with-imagick
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking how to run the C preprocessor... cc -E
checking for egrep -e... (cached) /bin/grep -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking target system type... x86_64-pc-linux-musl
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20230831
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable the imagick extension... yes, shared
checking for pkg-config... /usr/bin/pkg-config
checking ImageMagick MagickWand API configuration program... checking Testing /usr/local/bin/MagickWand-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... It exists
found in /usr/bin/MagickWand-config
checking if ImageMagick version is at least 6.2.4... found version 7.1.1-32 Q16 HDRI
checking for MagickWand.h or magick-wand.h header... user location /usr/include/ImageMagick-7/MagickWand/MagickWand.h
checking PHP version is at least 5.3.2... yes. found 8.3.10
libs
-lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI


checking for MagickGetVersion... yes
checking omp_pause_resource_all usability... yes
checking Which flavour of OpenMP to link... checking for omp_pause_resource_all... no
checking for __omp_pause_resource_all... no
checking for omp_pause_resource_all in -lgomp... yes
GCC flavoured OpenMP
checking for a sed that does not truncate output... /bin/sed
checking for ld used by cc... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
/tmp/pear/temp/imagick/configure: line 6825: /usr/bin/file: not found
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/x86_64-alpine-linux-musl/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE   -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagick_file.c -o imagick_file.lo  -MMD -MF imagick_file.dep -MT imagick_file.lo
mkdir .libs
 cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagick_file.c -MMD -MF imagick_file.dep -MT imagick_file.lo  -fPIC -DPIC -o .libs/imagick_file.o
/bin/sh /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE   -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagick_class.c -o imagick_class.lo  -MMD -MF imagick_class.dep -MT imagick_class.lo
 cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagick_class.c -MMD -MF imagick_class.dep -MT imagick_class.lo  -fPIC -DPIC -o .libs/imagick_class.o
/bin/sh /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE   -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagickdraw_class.c -o imagickdraw_class.lo  -MMD -MF imagickdraw_class.dep -MT imagickdraw_class.lo
 cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagickdraw_class.c -MMD -MF imagickdraw_class.dep -MT imagickdraw_class.lo  -fPIC -DPIC -o .libs/imagickdraw_class.o
/bin/sh /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE   -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagickpixel_class.c -o imagickpixel_class.lo  -MMD -MF imagickpixel_class.dep -MT imagickpixel_class.lo
 cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagickpixel_class.c -MMD -MF imagickpixel_class.dep -MT imagickpixel_class.lo  -fPIC -DPIC -o .libs/imagickpixel_class.o
/bin/sh /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE   -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagickpixeliterator_class.c -o imagickpixeliterator_class.lo  -MMD -MF imagickpixeliterator_class.dep -MT imagickpixeliterator_class.lo
 cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagickpixeliterator_class.c -MMD -MF imagickpixeliterator_class.dep -MT imagickpixeliterator_class.lo  -fPIC -DPIC -o .libs/imagickpixeliterator_class.o
/bin/sh /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE   -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagick_helpers.c -o imagick_helpers.lo  -MMD -MF imagick_helpers.dep -MT imagick_helpers.lo
 cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagick_helpers.c -MMD -MF imagick_helpers.dep -MT imagick_helpers.lo  -fPIC -DPIC -o .libs/imagick_helpers.o
/bin/sh /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE   -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagick.c -o imagick.lo  -MMD -MF imagick.dep -MT imagick.lo
 cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagick.c -MMD -MF imagick.dep -MT imagick.lo  -fPIC -DPIC -o .libs/imagick.o
/bin/sh /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE   -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagickkernel_class.c -o imagickkernel_class.lo  -MMD -MF imagickkernel_class.dep -MT imagickkernel_class.lo
 cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/imagickkernel_class.c -MMD -MF imagickkernel_class.dep -MT imagickkernel_class.lo  -fPIC -DPIC -o .libs/imagickkernel_class.o
/bin/sh /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE   -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/shim_im6_to_im7.c -o shim_im6_to_im7.lo  -MMD -MF shim_im6_to_im7.dep -MT shim_im6_to_im7.lo
 cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/imagick/shim_im6_to_im7.c -MMD -MF shim_im6_to_im7.dep -MT shim_im6_to_im7.lo  -fPIC -DPIC -o .libs/shim_im6_to_im7.o
/bin/sh /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/libtool --tag=CC --mode=link cc -shared -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/include -I/tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/main -I/tmp/pear/temp/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-7  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE    -o imagick.la -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/modules  imagick_file.lo imagick_class.lo imagickdraw_class.lo imagickpixel_class.lo imagickpixeliterator_class.lo imagick_helpers.lo imagick.lo imagickkernel_class.lo shim_im6_to_im7.lo -lgomp -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI
cc -shared  .libs/imagick_file.o .libs/imagick_class.o .libs/imagickdraw_class.o .libs/imagickpixel_class.o .libs/imagickpixeliterator_class.o .libs/imagick_helpers.o .libs/imagick.o .libs/imagickkernel_class.o .libs/shim_im6_to_im7.o  -lgomp -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI  -Wl,-soname -Wl,imagick.so -o .libs/imagick.so
creating imagick.la
(cd .libs && rm -f imagick.la && ln -s ../imagick.la imagick.la)
/bin/sh /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/libtool --tag=CC --mode=install cp ./imagick.la /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/modules
cp ./.libs/imagick.so /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/modules/imagick.so
cp ./.libs/imagick.lai /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/modules/imagick.la
PATH="$PATH:/sbin" ldconfig -n /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /tmp/pear/temp/pear-build-defaultuserGBnDEj/imagick-3.7.0/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0" install
Installing shared extensions:     /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/lib/php/extensions/no-debug-non-zts-20230831/
Installing header files:          /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/include/php/
running: find "/tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0" | xargs ls -dils
1580308      4 drwxr-xr-x    3 root     root          4096 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0
1580353      4 drwxr-xr-x    3 root     root          4096 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr
1580354      4 drwxr-xr-x    4 root     root          4096 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local
1580359      4 drwxr-xr-x    3 root     root          4096 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/include
1580360      4 drwxr-xr-x    3 root     root          4096 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/include/php
1580361      4 drwxr-xr-x    3 root     root          4096 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/include/php/ext
1580362      4 drwxr-xr-x    2 root     root          4096 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/include/php/ext/imagick
1580363      4 -rw-r--r--    1 root     root          1828 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/include/php/ext/imagick/php_imagick_shared.h
1580355      4 drwxr-xr-x    3 root     root          4096 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/lib
1580356      4 drwxr-xr-x    3 root     root          4096 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/lib/php
1580357      4 drwxr-xr-x    3 root     root          4096 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/lib/php/extensions
1580358      4 drwxr-xr-x    2 root     root          4096 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/lib/php/extensions/no-debug-non-zts-20230831
1580352   1424 -rwxr-xr-x    1 root     root       1457048 Aug 15 18:29 /tmp/pear/temp/pear-build-defaultuserGBnDEj/install-imagick-3.7.0/usr/local/lib/php/extensions/no-debug-non-zts-20230831/imagick.so

Build process completed successfully
Installing '/usr/local/include/php/ext/imagick/php_imagick_shared.h'
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20230831/imagick.so'
install ok: channel://pecl.php.net/imagick-3.7.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
/ #

@phoehnel
Copy link

phoehnel commented Aug 15, 2024

Got a pipeline building this every week. For me the first successful run was on 16th of July using the following dockerfile.

FROM php:8.3-apache-bullseye
ENV DEBIAN_FRONTEND=noninteractive
RUN set -e; apt-get update -y; \
	apt-get install -y 	libonig-dev zlib1g zlib1g-dev apt-utils \
						ca-certificates wget curl vim nano ssh \
						default-mysql-client libfreetype6-dev \
						libjpeg-dev libmagickwand-dev libpng-dev \
						libzip-dev libldb-dev libldap2-dev libmagickcore-dev \
						python3 python3-pip libaugeas0 cron \
						libapache2-mod-auth-openidc; \
	docker-php-ext-install 	mysqli bcmath exif gd opcache \
							zip pdo_mysql ldap mbstring gettext xml; \
	pecl install imagick-3.7.0; \
	docker-php-ext-enable imagick

@dinamic
Copy link

dinamic commented Aug 16, 2024

@ErroneousBosch not sure why it works for you. It's still a fail for me - please find details at the pastebin link below.

I could see you're using x86_64, while I'm using aarch64. Could it be broken for arm64 only? 🤔

https://pastebin.com/w2dterQX

@ErroneousBosch
Copy link

@dinamic I definitely think the architecture here is the most likely part of the issue. It looks like @mashb1t was reporting the same error on an M1/ARM processor. Is @FedericoHeichou also on ARM?

@FedericoHeichou
Copy link
Author

@dinamic I definitely think the architecture here is the most likely part of the issue. It looks like @mashb1t was reporting the same error on an M1/ARM processor. Is @FedericoHeichou also on ARM?

No, mine it is a amd64

@tommmoe
Copy link

tommmoe commented Aug 18, 2024

Makes sense as to why it works on my ryzen but doesn't make sense as to why it doesn't work on my m5 EC2 instances, which should be Xenon and that should be amd64.. I'll check out what it's building tomorrow..

@ErroneousBosch
Copy link

ErroneousBosch commented Aug 22, 2024

So it now no longer works for me, neither on the alpine image nor in a debian bookworm image, on the same machine that it was working on before, same x86_64 install, with the same commands that have worked previously, and using the same version of imagick (3.7.0). tried removing the php:8.3-alpine image and repulling, still not working.

@ErroneousBosch
Copy link

ErroneousBosch commented Aug 22, 2024

I can confirm that the following does work in 8.3:

docker run -it --rm php:8.3-alpine sh
apk update
apk add imagemagick imagemagick-dev gcc make autoconf g++ git
cd /tmp 
git clone https://github.com/Imagick/imagick.git 
pecl install /tmp/imagick/package.xml 

This builds from the master git branch rather than the pre-packaged release, which is now over two and a half years old -- Jan 2022. I suspect that until/unless they put out a new release, this is the workaround.

@bicpi
Copy link

bicpi commented Sep 2, 2024

In case this might helps someone else to get unblocked from imagick issues: we got independent of it by migrating our use cases to libvips, using the php-vips package. It works very well and is even faster while consuming less memory.

@StrangePeanut
Copy link

@bicpi is that a drop in replacement for imagick? Alternatives have always existed but fail to pass imagick presence check which renders them useless for many of us.

@bicpi
Copy link

bicpi commented Sep 2, 2024

@StrangePeanut No, it has a different API, see the docs. But after re-working, the imagick extension is not needed anymore.

But of course this is only possible when controlling all Imagick usage, not when dependent packages or e.g. a CMS requires it.

@FedericoHeichou
Copy link
Author

In case this might helps someone else to get unblocked from imagick issues: we got independent of it by migrating our use cases to libvips, using the php-vips package. It works very well and is even faster while consuming less memory.

Seems cool. If it is really as described would be nice to create a wrapper

@Mr-Maniac
Copy link

I also wanted to report that imagick sometimes builds correctly on php 8.3 bookworm image. The last month it seems to have been building correctly almost every time.
But today I had a 50/50 chance (in a pipeline - same runner).
Very strange, indeed, that it succeeds sometime....

@juhasev
Copy link

juhasev commented Sep 14, 2024

I managed to get this working on Amazon Linux 2023 with PHP 8.3. Here is the docker file for anybody who might need it!

FROM amazonlinux:2023

ARG IMAGICK_PHP83_FIX_COMMIT=9df92616f577e38625b96b7b903582a46c064739

ENV TERM=xterm-256color
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV COMPOSER_HOME=/var/www/html
ENV PATH=$PATH:vendor/bin:/usr/local/bin

RUN yum install -y \
    ruby \
    nodejs \
    php-pear \
    php \
    php-cli \
    php-devel \
    php-gmp \
    php-fpm \
    php-mbstring \
    php-opcache \
    php-common \
    php-pdo \
    php-mysqlnd \
    php-gd \
    php-sodium \
    php-xml \
    php-process \
    php-zip \
    python3-pip \
    htop \
    ncurses \
    findutils \
    unzip

RUN yum install -y \
    php-devel \
    php-pear \
    gcc \
    make \
    tar \
    ImageMagick \
    ImageMagick-devel \
    ImageMagick-perl

RUN curl -L https://github.com/remicollet/imagick/archive/${IMAGICK_PHP83_FIX_COMMIT}.zip -o /tmp/imagick-issue-php83.zip  \
    && unzip /tmp/imagick-issue-php83.zip -d /tmp \
    && pecl install /tmp/imagick-${IMAGICK_PHP83_FIX_COMMIT}/package.xml \
    && echo "extension=imagick" > /etc/php.d/20-imagick.ini

# Remove dev package to keep the container small
RUN yum remove -y \
    php-devel \
    php-pear \
    gcc \
    make \
    ImageMagick-devel \
    ImageMagick-perl

@ghnp5
Copy link

ghnp5 commented Sep 17, 2024

This seems to be completely random.
Just need to keep running the build until it finally works...

@ilyahoilik
Copy link

I would not recommend you guys installing imagick/imagick@master version because you do not have 100% guarantee that new commits will not contain any issues and bugs.

Instead I may suggest you to install package not from branch but commit:

RUN install-php-extensions imagick/imagick@28f27044e435a2b203e32675e942eb8de620ee58

This approach guarantees that every your environment now and later will receive the same version of imagick and their new code will not break your deployment process.

https://github.com/mlocati/docker-php-extension-installer

@ghnp5
Copy link

ghnp5 commented Sep 24, 2024

Thanks @ilyahoilik - I didn't realize it installed from the repo's master/main like that.

However, looking at the "master" branch in imagick/imagick, the last commit was "last year", so it still doesn't make sense that it "randomly breaks".

Or am I missing something here? :)

@ilyahoilik
Copy link

ilyahoilik commented Sep 24, 2024

Or am I missing something here? :)

@ghnp5 ooops, I didn't look up to commit date, thought master branch updates regularly. My fault, sorry :) Anyway you can use my suggestion to install specific commit from any branch

@phoehnel
Copy link

Got a pipeline building this every week. For me the first successful run was on 16th of July using the following dockerfile.

FROM php:8.3-apache-bullseye
[...]

After an update of the php:8.3-apache-bullseye it stopped working for me again.
It now only works pinning the following version. Newer ones fail.

FROM php@sha256:7fb7a483bf2e0b4ea40a1918c6efc0574c049750dcb25c779e01c36af0778fe6

@lindelius
Copy link

lindelius commented Oct 21, 2024

Sorry for adding another bump to this, but can we please get a new version released so that we can finally install this extension via PECL for PHP 8.3? @Danack

@cardil
Copy link

cardil commented Nov 12, 2024

Complete workaround, that worked for me (with pinned versions):

FROM docker.io/library/php:8-fpm
ADD --chmod=0755 \
  https://github.com/mlocati/docker-php-extension-installer/releases/download/2.6.3/install-php-extensions \
  /usr/local/bin/
# TODO: Use latest released version, after https://github.com/Imagick/imagick/issues/640 is fixed
RUN install-php-extensions imagick/imagick@28f27044e435a2b203e32675e942eb8de620ee58

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

Successfully merging a pull request may close this issue.