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的头文件或库,按以下步骤修复:
- 验证libheif的pkg-config配置:
pkg-config --list-all | grep heif # 无输出则手动指定路径 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH - 重新配置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 - 验证HEIC支持是否生效:
输出包含convert -list format | grep HEICHEIC* rw-即为配置成功。
三、cPanel环境额外适配
- 替换系统默认版本后,更新cPanel关联配置:
/usr/local/cpanel/bin/rebuild_imagemagick - 若使用EA4环境,先卸载自带的ImageMagick:
yum remove ea-php*-imagemagick imagemagick
内容的提问来源于stack exchange,提问作者RS-
相关产品推荐
相关产品推荐

