Problem with Installing ImageMagick for PHP 8.4 in Docker.
Lukas Hron

Lukas Hron @lukashron

About: Web app developer from Czech Republic. GitHub @lukashron

Location:
Czech Republic
Joined:
Apr 17, 2024

Problem with Installing ImageMagick for PHP 8.4 in Docker.

Publish Date: Feb 27
1 0

If you use the ImageMagick extension and plan to upgrade to PHP 8.3 or 8.4, you will encounter an issue with installation via PECL. Unfortunately, the PECL package is not compatible with these PHP versions, causing the installation to fail. As an alternative, you can build the source code directly from the repository, which allows you to bypass this issue and successfully configure ImageMagick.

RUN apt-get update && apt-get install -y \
    imagemagick \
    libmagickwand-dev \
    && git clone https://github.com/Imagick/imagick --depth 1 /tmp/imagick \
    && cd /tmp/imagick \
    && phpize && ./configure \
    && make \
    && make install \
    && apt-get clean

RUN docker-php-ext-enable imagick
Enter fullscreen mode Exit fullscreen mode

Comments 0 total

    Add comment