ImageMagick网址
http://www.imagemagick.org/script/install-source.php
#wget http://www.imagemagick.org/download/ImageMagick.tar.gz
#tar xvfz ImageMagick.tar.gz
#cd ImageMagick-7.0.8-68/
#./configure --prefix=/usr/local/imagemagick
#make && make install
官网地址:http://pecl.php.net/package/imagick
#wget https://pecl.php.net/get/imagick-3.4.4.tgz
#tar zxvf imagick-3.4.4.tgz
#cd imagick-3.4.4/
#/usr/local/php/bin/phpize
#ln -s /usr/local/imagemagick/include/ImageMagick-7 /usr/local/imagemagick/include/ImageMagick
./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/imagemagick
#make
#make install
查看PHPinfo信息,搜索extension_dir(以windows的为例),看下路径,然后在,php文件添加上
修改php.ini
extension = "php_imagick.dll"
linux 应为
extension = "php_imagick.so"
(完成)
首先确认各种格式的图片代理有没有安装
错误信息
> 安装 ImageMagick 代理
docker的alpine系统中需要apk安装:
apk add jpeg-dev libpng-dev freetype-dev
有时安装imagick是会提示:
1
“configure: error: not found. Please provide a path to MagickWand-config
or
Wand-config program.”
这是因为只安装了“ImageMagick”而没有安装“ImageMagick-devel”,通过下面的命令行安装ImageMagick-devel,然后重新按上面的步骤安装imagick就好了。
1
yum install ImageMagick-devel
或者
sudo apt-get install libmagickcore-dev libmagickwand-dev
(;configure通过,在make时出现错误error: wand/MagickWand.h: No such file or directory
解决办法:
#yum install gtk2-devel
#export PKG_CONFIG_PATH=/usr/local/imagemagick/lib/pkgconfig/
;
;然后重新安装imagick
;
#cd imagick-3.4.3RC3/
#/usr/local/php/bin/phpize
#./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/imagemagick
#make
#make install)
修改php.ini文件,添加extension=fileinfo.so
nginx重启命令:systemctl restart nginx
php重启命令:systemctl restart php-fpm
3.安装Ghostscript
下载地址 https://www.ghostscript.com/download/gsdnld.html
tar zxvf ghostscript-9.26-linux-x86_64.tgz
cd ghostscript-9.26-linux-x86_64
mv gs-926-linux-x86_64 /usr/bin/gs
完成
手机扫一扫
移动阅读更方便
你可能感兴趣的文章