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

Adding php-imagick extension to Alpine Docker container fails #683

Open
4d4ch4u32 opened this issue Jul 30, 2024 · 4 comments
Open

Adding php-imagick extension to Alpine Docker container fails #683

4d4ch4u32 opened this issue Jul 30, 2024 · 4 comments

Comments

@4d4ch4u32
Copy link

I try to add the imagick php extension to my Docker container:

FROM php:8.3-fpm-alpine AS base

RUN apk add --update --no-cache --virtual .build-deps $PHPIZE_DEPS imagemagick imagemagick-dev \
    && pecl install imagick \
    && docker-php-ext-enable imagick \
    &&  rm -rf /tmp/pear \
    && apk del .build-deps

The process fails with the following error:

14.37 PHP-Parser-5.0.0/phpstan.neon.dist
14.38 Saved /tmp/pear/temp/imagick/ImagickPixel_arginfo.h
14.38 Parse /tmp/pear/temp/imagick/Imagick.stub.php to generate /tmp/pear/temp/imagick/Imagick_arginfo.h
14.41 In /tmp/pear/temp/imagick/Imagick.stub.php:
14.41 Unterminated preprocessor conditions
14.41 make: *** [Makefile:196: /tmp/pear/temp/imagick/Imagick_arginfo.h] Error 1
14.41 ERROR: `make INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuserAclDeF/install-imagick-3.7.0" install' failed
------
failed to solve: process "/bin/sh -c apk add --update --no-cache --virtual .build-deps $PHPIZE_DEPS imagemagick imagemagick-dev     && pecl install imagick     && docker-php-ext-enable imagick     &&  rm -rf /tmp/pear     && apk del .build-deps" did not complete successfully: exit code: 1
@BS666
Copy link

BS666 commented Aug 1, 2024

Encountering this since php 8.3.10 on CentOs 9 with default install options by pear as well.

@jdmaguire
Copy link

See #640, known issue.

It seems like master has a fix but no release yet has a fix. Either one needs to wait for a release or build from source.

@vknowles-rv
Copy link

Not making light of OSS being hard, but IMO if you can get away with using the gd extension instead I'd go that route.

This extension hasn't seen a healthy amount of development in over a year.

@feisar-uk
Copy link

This works for me in PHP 8.3 - 8.3.11

# Install Imagick - works in PHP 8.3
RUN apt-get install -y libmagickwand-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /usr/src/php/ext/imagick
RUN chmod 777 /usr/src/php/ext/imagick
RUN curl -fsSL https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz | tar xvz -C "/usr/src/php/ext/imagick" --strip 1
RUN docker-php-ext-install imagick
RUN rm /etc/ImageMagick-6/policy.xml

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

No branches or pull requests

5 participants