未解决,感觉是php的问题,但我懒得编译了,放弃webp。

修改oneinstack目录的include/ImageMagick.sh

vi /root/oneinstack/include/ImageMagick.sh

找到./configure,在最后加入--with-webp=yes

修改(注意有两处)

./configure --prefix=${imagick_install_dir} --enable-shared --enable-static
./configure --with-php-config=${php_install_dir}/bin/php-config --with-imagick=${imagick_install_dir}

./configure --prefix=${imagick_install_dir} --enable-shared --enable-static --with-webp=yes
./configure --with-php-config=${php_install_dir}/bin/php-config --with-imagick=${imagick_install_dir} --with-webp=yes

卸载重装imagick

卸载imagick

/root/oneinstack/uninstall.sh --php_extensions imagick

重装imagick

/root/oneinstack/install.sh --php_extensions imagick

查看是否支持webp

php -r "print_r(Imagick::queryFormats());"

原文:

https://www.wd-ljt.com/post/0802/587.html
https://jovialchap.com/add-webp-support-for-imagick-on-oneinstack/

文章目录