mlocati / docker-php-extension-installer

Easily install PHP extensions in Docker containers
MIT License
4.18k stars 378 forks source link

installing imagick fails with php 8.3-bookworm #925

Closed daudo closed 3 months ago

daudo commented 3 months ago

Version of install-php-extensions

2.2.14

Error description

installing imagick fails like below. Unfortunately, I do not see an apparent reason ...

$ docker build -t foobar-php83 .
[...]
74.59 (cd .libs && rm -f imagick.la && ln -s ../imagick.la imagick.la)
74.59 /bin/bash /tmp/pear/temp/pear-build-defaultuserIugDa8/imagick-3.7.0/libtool --tag=CC --mode=install cp ./imagick.la /tmp/pear/temp/pear-build-defaultuserIugDa8/imagick-3.7.0/modules
74.65 cp ./.libs/imagick.so /tmp/pear/temp/pear-build-defaultuserIugDa8/imagick-3.7.0/modules/imagick.so
74.67 cp ./.libs/imagick.lai /tmp/pear/temp/pear-build-defaultuserIugDa8/imagick-3.7.0/modules/imagick.la
74.71 PATH="$PATH:/sbin" ldconfig -n /tmp/pear/temp/pear-build-defaultuserIugDa8/imagick-3.7.0/modules
74.72 ----------------------------------------------------------------------
74.72 Libraries have been installed in:
74.72    /tmp/pear/temp/pear-build-defaultuserIugDa8/imagick-3.7.0/modules
74.72 
74.72 If you ever happen to want to link against installed libraries
74.72 in a given directory, LIBDIR, you must either use libtool, and
74.72 specify the full pathname of the library, or use the `-LLIBDIR'
74.72 flag during linking and do at least one of the following:
74.72    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
74.72      during execution
74.72    - add LIBDIR to the `LD_RUN_PATH' environment variable
74.72      during linking
74.72    - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
74.72    - have your system administrator add LIBDIR to `/etc/ld.so.conf'
74.72 
74.72 See any operating system documentation about shared libraries for
74.72 more information, such as the ld(1) and ld.so(8) manual pages.
74.72 ----------------------------------------------------------------------
74.73 
74.73 Build complete.
74.73 Don't forget to run 'make test'.
74.73 
74.74 running: make -j4 INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuserIugDa8/install-imagick-3.7.0" install
74.75 Parse /tmp/pear/temp/imagick/ImagickPixel.stub.php to generate /tmp/pear/temp/imagick/ImagickPixel_arginfo.h
74.75 Parse /tmp/pear/temp/imagick/Imagick.stub.php to generate /tmp/pear/temp/imagick/Imagick_arginfo.h
74.79 sh: 1: wget: not found
74.80   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
74.80                                  Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Installing header files:          /tmp/pear/temp/pear-build-defaultuserIugDa8/install-imagick-3.7.0/usr/local/include/php/
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  141k  100  141k    0     0   283k      0 --:--:-- --:--:-- --:--:--  283k
75.31 PHP-Parser-5.0.0/.php-cs-fixer.dist.php
75.31 PHP-Parser-5.0.0/LICENSE
75.32 PHP-Parser-5.0.0/Makefile
75.32 PHP-Parser-5.0.0/README.md
75.32 PHP-Parser-5.0.0/bin/
75.32 PHP-Parser-5.0.0/bin/php-parse

[...]

75.45 In /tmp/pear/temp/imagick/Imagick.stub.php:
75.45 Unterminated preprocessor conditions
75.45 make: *** [Makefile:196: /tmp/pear/temp/imagick/Imagick_arginfo.h] Error 1
75.48 ERROR: `make -j4 INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuserIugDa8/install-imagick-3.7.0" install' failed
[...]

Docker image

php:8.3-fpm-bookworm

Minimal Dockerfile

FROM php:8.3-fpm-bookworm
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN install-php-extensions imagick
mlocati commented 3 months ago

This is a known issue - see the discussion at https://github.com/mlocati/docker-php-extension-installer/pull/811

daudo commented 3 months ago

Just one final note for others struggling with the same: the most simple workaround today (2024-05-31) seems to be to build against the imagick master branch, ie

RUN install-php-extensions imagick/imagick@master

Even if this fixes the build problem, running on the master=main=devel branch may lead to other problems later however ...