Featured image of post Solve the "imagick-3.7.0 install failed" issue when installing Imagick with Docker's install-php-extensions.

Solve the "imagick-3.7.0 install failed" issue when installing Imagick with Docker's install-php-extensions.

Solve the "imagick-3.7.0 install failed" issue when installing Imagick with Docker's install-php-extensions.

Photo by Ben Griffiths on Unsplash

Docker Installation Imagick Error

RUN install-php-extensions imagick

Error Message

22.24 Saved /tmp/pear/temp/imagick/ImagickPixel_arginfo.h
22.25 In /tmp/pear/temp/imagick/Imagick.stub.php:
22.25 Unterminated preprocessor conditions
22.26 make: *** [Makefile:196: /tmp/pear/temp/imagick/Imagick_arginfo.h] Error 1
22.26 ERROR: `make -j10 INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuserAdMKLn/install-imagick-3.7.0" install' failed

Solution

Specify the correct version master 28f27044e435a2b203e32675e942eb8de620ee58 when installing Imagick.

# https://github.com/Imagick/imagick/commits/master/
# RUN install-php-extensions imagick/imagick@master
RUN install-php-extensions imagick/imagick@28f27044e435a2b203e32675e942eb8de620ee58

The current master version works properly, but to avoid the risk of the master branch changing and potentially breaking the production environment, specify the current version number of master as 28f27044e435a2b203e32675e942eb8de620ee58.

Imagick Version Number: https://github.com/Imagick/imagick/commits/master/

Reference

All rights reserved,未經允許不得隨意轉載
Built with Hugo
Theme Stack designed by Jimmy