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

Problem with installing imagick #967

Closed
adam3278 opened this issue Aug 22, 2024 · 1 comment
Closed

Problem with installing imagick #967

adam3278 opened this issue Aug 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@adam3278
Copy link

Version of install-php-extensions

2.4.0

Error description

Hi,
I'm facing problems with using your installer. Sometimes it stucks at compiling some extensions (in this case imagick) and the whole process is terminated, but the docker image is being built without any problem. As the result, my builds have random issues I cannot predict. I'm using kaniko builder with gitlab for building docker images. Thank you for this awesome project, but there should be some option to automatic retry of installing extensions.

Error:

Unterminated preprocessor conditions
make: *** [Makefile:196: /tmp/pear/temp/imagick/Imagick_arginfo.h] Error 1
ERROR: `make -j6 INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuserlKFCJD/install-imagick-3.7.0" install' failed

Docker image

php:8.3-fpm-alpine

Minimal Dockerfile

RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

RUN apk update; \
    apk upgrade; \
    apk add --no-cache \
    g++ make autoconf bash yaml yaml-dev icu-dev imagemagick imagemagick-libs imagemagick-dev git libpq mysql-client nano

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN install-php-extensions @fix_letsencrypt; \
    install-php-extensions opcache imagick memcached exif intl zip mysqli excimer yaml;\
    install-php-extensions @composer
@adam3278 adam3278 added the bug Something isn't working label Aug 22, 2024
@mlocati
Copy link
Owner

mlocati commented Aug 23, 2024

RUN install-php-extensions @fix_letsencrypt; \
    install-php-extensions opcache imagick memcached exif intl zip mysqli excimer yaml;\
    install-php-extensions @composer

As stated in the README, imagick is not (yet) supported with PHP 8.3+ - see #811 and Imagick/imagick#640

install-php-extensions fails to install imagick on PHP 8.3+, and it exits with an error code.

The problem is in your dockerfile:

RUN install-php-extensions @fix_letsencrypt; \
    install-php-extensions opcache imagick memcached exif intl zip mysqli excimer yaml;\
    install-php-extensions @composer

With the above lines, you are saying:

  1. run
    install-php-extensions @fix_letsencrypt
  2. then ignore any errors (because you are using ;) and run
    install-php-extensions opcache imagick memcached exif intl zip mysqli excimer yaml
  3. then ignore any errors (because you are using ;) and run
    install-php-extensions @composer

since the last command succeeded, docker doesn't abort the build process.

You should instead have the following in your dockerfile:

RUN install-php-extensions @fix_letsencrypt && \
    install-php-extensions opcache imagick memcached exif intl zip mysqli excimer yaml && \
    install-php-extensions @composer

(remark the use of && instead of ;)
which means: run the install-php-extensions commands but abort with an error if any of them fails.

@mlocati mlocati closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants