简体   繁体   English

php 7.4 安装 Imagick 无法查找未定义的宏

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

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.我正在尝试在运行 php 7.4 的 Debian 10 服务器上安装 Imagick,但出现一个与宏相关的奇怪错误,我不明白这意味着什么。

pecl is installed pecl 已安装

here is sudo pecl install imagick这是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

I believe someone had published a buggy version of php7.4-dev which caused phpize failed to configure.我相信有人发布了 php7.4-dev 的错误版本,导致 phpize 无法配置。

I happened to had the latest working version docker image with php7.4-dev and compared with latest php7.4-dev installed.我碰巧用 php7.4-dev 安装了最新的工作版本 docker 镜像,并与安装的最新 php7.4-dev 进行了比较。 Found /usr/bin/phpize has the following diff.发现/usr/bin/phpize有以下差异。

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.作为临时解决方案,我认为如果您在/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)

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.我相信最新的包已经解决了问题,请再次 apt-get update 和 apt-get install php7.4-dev 来解决问题。

Suddenly today i had the same issue on Ubuntu though.今天突然我在 Ubuntu 上遇到了同样的问题。 This used to work a while ago.这曾经工作过一段时间。

But for imagick you dont need to use PECL anymore, you can probably just use:但是对于 imagick,您不再需要使用 PECL,您可以使用:

sudo apt install php-imagick

PHP imagick should be packaged for Debian: https://packages.debian.org/buster/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