【问题标题】:php 7.4 install Imagick fails looking for undefined macrophp 7.4 install Imagick 找不到未定义的宏
【发布时间】:2020-10-17 12:43:47
【问题描述】:

我正在尝试在运行 php 7.4 的 Debian 10 服务器上安装 Imagick,但我收到一个奇怪的宏相关错误,我不明白这意味着什么。

pecl 已安装

这里是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

【问题讨论】:

    标签: php imagick


    【解决方案1】:

    我相信有人发布了 php7.4-dev 的错误版本,导致 phpize 无法配置。

    我碰巧安装了带有 php7.4-dev 的最新工作版本 docker 映像,并与安装了最新的 php7.4-dev 进行了比较。发现 /usr/bin/phpize 有以下差异。

    作为一种临时解决方案,我认为如果您在/usr/bin/phpize 中注释掉(cd "$aclocaldir" && cp $LIBTOOL_FILES "$builddir"/build) 行,并将FIELDS_BUILD 更改为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",它应该可以工作。

    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)
    

    更新:

    我相信最新的软件包已经解决了这个问题,请 apt-get update 和 apt-get install php7.4-dev 再次解决这个问题。

    【讨论】:

    • 你美丽的灵魂 :) 谢谢!我想问一下你是怎么知道这个错误的?在某个地方有跟踪器吗?
    • @Sam,我几天前碰巧安装成功,所以我有要比较的 docker 映像,我比较了 phpize。我认为尚未报告此错误,但我认为应该报告。 bugs.debian.org/cgi-bin/…
    • 哈哈,这个主题会影响我未来的更新吗?我应该在某个时候恢复到原始文件吗?抱歉,我不太了解我们到底做了什么。
    【解决方案2】:

    今天我突然在 Ubuntu 上遇到了同样的问题。 这曾经在不久前起作用。

    但是对于 imagick 你不再需要使用 PECL,你可以只使用:

    sudo apt install php-imagick
    

    PHP imagick 应该为 Debian 打包:https://packages.debian.org/buster/php-imagick

    【讨论】:

    • 我这样做了,但仍然是同样的问题
    猜你喜欢
    • 2011-04-16
    • 1970-01-01
    • 2015-06-23
    • 2020-12-29
    • 1970-01-01
    • 2020-12-17
    • 1970-01-01
    • 1970-01-01
    • 2020-01-29
    相关资源
    最近更新 更多