簡體   English   中英

php 7.4 安裝 Imagick 無法查找未定義的宏

[英]php 7.4 install Imagick fails looking for undefined macro

我正在嘗試在運行 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

我相信有人發布了 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 來解決問題。

今天突然我在 Ubuntu 上遇到了同樣的問題。 這曾經工作過一段時間。

但是對於 imagick,您不再需要使用 PECL,您可以使用:

sudo apt install php-imagick

PHP imagick 應該為 Debian 打包: https ://packages.debian.org/buster/php-imagick

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM