You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CentOS7/CloudLinux+cPanel环境下安装带HEIC支持的ImageMagick7

解决cPanel/CentOS7/CloudLinux下编译带HEIC支持的ImageMagick问题

一、处理libde265/libheif编译时的make报错

出现make: *** No targets specified and no makefile found. Stop.是因为未生成Makefile或依赖缺失,按以下步骤重新编译:

  • 先安装编译基础依赖:
    yum install -y gcc gcc-c++ cmake git automake autoconf libtool pkg-config epel-release
    
  • 编译libde265:
    git clone https://github.com/strukturag/libde265.git
    cd libde265
    ./autogen.sh
    ./configure --prefix=/usr/local
    make && make install
    ldconfig
    cd ..
    
  • 编译libheif:
    git clone https://github.com/strukturag/libheif.git
    cd libheif
    ./autogen.sh
    ./configure --prefix=/usr/local --with-libde265
    make && make install
    ldconfig
    cd ..
    

若autogen.sh执行失败,升级autotools工具:yum install autoconf269 automake116后重试。

二、解决ImageMagick configure时HEIC检测异常(对应你提到的第677行问题)

日志异常核心是系统无法定位libheif的头文件或库,按以下步骤修复:

  1. 验证libheif的pkg-config配置:
    pkg-config --list-all | grep heif
    # 无输出则手动指定路径
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
    
  2. 重新配置ImageMagick,明确指定HEIC路径:
    git clone https://github.com/ImageMagick/ImageMagick.git
    cd ImageMagick
    ./configure --prefix=/usr/local --with-heic=yes --with-heic-include=/usr/local/include --with-heic-lib=/usr/local/lib
    make && make install
    ldconfig
    
  3. 验证HEIC支持是否生效:
    convert -list format | grep HEIC
    
    输出包含HEIC* rw-即为配置成功。

三、cPanel环境额外适配

  • 替换系统默认版本后,更新cPanel关联配置:
    /usr/local/cpanel/bin/rebuild_imagemagick
    
  • 若使用EA4环境,先卸载自带的ImageMagick:
    yum remove ea-php*-imagemagick imagemagick
    

内容的提问来源于stack exchange,提问作者RS-

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 15:12:10