一、安装heic支持组件
yum install libheif*
二、安装ImageMagick
//下载资源,结尾改为.tar.gz,并解压
wget https://codeload.github.com/ImageMagick/ImageMagick/tar.gz/refs/tags/7.1.0-16进入指定目录
cd /root/ImageMagick-7.1.0-16///配置,查看是否支持heic,不支持换个版本。
./configure --prefix=/usr/local/imagemagick --with-heic=yes --with-png=yes --with-webp=yes
//或者用./configure --with-heic=yes//安装
make && make install
三、引入环境
echo "export PATH=$PATH:/usr/local/ImageMagick/bin" >> /etc/profile
source /etc/profile
ldconfig /usr/local/lib
四、安装PHP函数imagick
wget https://pecl.php.net/get/imagick-3.7.0.tgz
tar -xzvf imagick-3.7.0.tgz
cd /root/imagick-3.7.0
/www/server/php/81/bin/phpize
./configure --with-php-config=/www/server/php/81/bin/php-config --with-imagick=/usr/local/ImageMagick-7.1.0
export PKG_CONFIG_PATH=/usr/local/ImageMagick-7.1.0/lib/pkgconfig
make && make install
五、其他
一定要取消禁用函数:proc_open
查看版本:convert -version
删除ImageMagick:sudo yum remove ImageMagick
检查命令看看 imagick 扩展是否安装和启用:php -m | grep -i "imagick"
HEIC缩略图:在config.php内添加 17 => 'OC\\Preview\\HEIC', 重启php nginx
更多参考:
https://blog.csdn.net/nathan_csdn/article/details/126100165
https://blog.csdn.net/qq_33215204/article/details/127795619
https://www.himstudy.net/%e8%a7%a3%e5%86%b3nextcloud%e4%b8%8d%e6%98%be%e7%a4%baheic%e6%96%87%e4%bb%b6%e7%bc%a9%e7%95%a5%e5%9b%be%e7%9a%84%e9%97%ae%e9%a2%98/
https://www.himstudy.net/%E8%A7%A3%E5%86%B3nextcloud%E6%97%A0%E6%B3%95%E5%9C%A8%E7%BA%BF%E6%89%93%E5%BC%80heic%E5%9B%BE%E7%89%87%E7%9A%84%E9%97%AE%E9%A2%98/
https://www.jianshu.com/p/59128bd94d00
make报错:make[1]: *** [server.o] Error 1(已解决)
升级gcc:https://blog.csdn.net/fox372/article/details/111703943
执行编译出来的可执行程序时报错:error while loading shared libraries: xxx.so: cannot open shared object file: No such file or directory
https://blog.csdn.net/weixin_44843859/article/details/110632136