skip to Main Content

I am trying to install Imagick on my Debian 10 server running php 7.4 but I am getting a strange macro related error and I do not understand what that means.

pecl is installed

here is sudo pecl install imagick

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading imagick-3.4.4.tgz ...
Starting to download imagick-3.4.4.tgz (253,434 bytes)
.....................................................done: 253,434 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
configure.ac:161: warning: LTOPTIONS_VERSION is m4_require'd but not m4_defun'd
build/libtool.m4:61: LT_INIT is expanded from...
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:161: the top level
configure.ac:161: warning: LTSUGAR_VERSION is m4_require'd but not m4_defun'd
build/libtool.m4:61: LT_INIT is expanded from...
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:161: the top level
configure.ac:161: warning: LTVERSION_VERSION is m4_require'd but not m4_defun'd
build/libtool.m4:61: LT_INIT is expanded from...
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:161: the top level
configure.ac:161: warning: LTOBSOLETE_VERSION is m4_require'd but not m4_defun'd
build/libtool.m4:61: LT_INIT is expanded from...
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:161: the top level
configure:4702: error: possibly undefined macro: m4_ifval
  If this token and others are legitimate, please use m4_pattern_allow.
  See the Autoconf documentation.
configure:8297: error: possibly undefined macro: _LT_SET_OPTIONS
configure:8297: error: possibly undefined macro: LT_INIT
ERROR: `phpize' failed

2

Answers


  1. Suddenly today i had the same issue on Ubuntu though.
    This used to work a while ago.

    But for imagick you dont need to use PECL anymore, you can probably just use:

    sudo apt install php-imagick
    

    PHP imagick should be packaged for Debian: https://packages.debian.org/buster/php-imagick

    Login or Signup to reply.
  2. I believe someone had published a buggy version of php7.4-dev which caused phpize failed to configure.

    I happened to had the latest working version docker image with php7.4-dev and compared with latest php7.4-dev installed. Found /usr/bin/phpize has the following diff.

    As a temporally solution, I think if you comment out (cd "$aclocaldir" && cp $LIBTOOL_FILES "$builddir"/build) line in /usr/bin/phpize, and change FIELDS_BUILD to FILES_BUILD="php.m4 shtool libtool.m4 ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4 pkg.m4 config.guess config.sub ltmain.sh Makefile.global" it should work.

    root@9dff9e6bd67b:/usr/bin# diff phpize-bad phpize-good
    12c12,13
    < FILES_BUILD="php.m4 shtool libtool.m4 ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4 pkg.m4 config.guess config.sub ltmain.sh Makefile.global"
    ---
    > aclocaldir="$prefix/share/aclocal"
    > FILES_BUILD="php.m4 shtool ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4 config.guess config.sub ltmain.sh Makefile.global"
    13a15
    > LIBTOOL_FILES="pkg.m4 libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4 glib-gettext.m4"
    147a150
    >   (cd "$aclocaldir" && cp $LIBTOOL_FILES "$builddir"/build)
    

    Updates:

    I believe the latest package already solved the issue, please apt-get update and apt-get install php7.4-dev again to solve the issue.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search