php安装imagemagick扩展
Posted if年少有为
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php安装imagemagick扩展相关的知识,希望对你有一定的参考价值。
1. 安装一些必要的yum
yum install tcl-devel.x86_64 libpng-devel.x86_64 libjpeg-devel.x86_64 ghostscript-devel.x86_64 bzip2-devel.x86_64 freetype-devel.x86_64 libtiff-devel.x86_64
yum install libjpeg-devel.x86_64 libpng-devel.x86_64 glib2-devel.x86_64 fontconfig-devel.x86_64 zlib-devel.x86_64 libwmf-devel.x86_64 freetype-devel.x86_64 libtiff-devel.x86_64
2. 安装zlib
tar zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make install
3.步骤3:安装libpng
tar zxvf libpng-1.4.4.tar.gz
cd libpng-1.6.21
cd scripts/
mv makefile.linux ../makefile
cd ..
make
make install
4.安装freetype
tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure
make
make install
5.安装Jpeg
wget http://www.imagemagick.org/download/delegates/jpegsrc.v9b.tar.gz
tar zxvf pegsrc.v9b.tar.gz
cd jpeg-9b
./configure --enable-shared
make libdir=/usr/lib64
make libdir=/usr/lib64 install
6.安装ImageMagick
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar -xzvf ImageMagick-6.6.8-10.tar.gz
./configure --prefix=/usr/local/imagemagick
make
make install
7.修改环境变量
vim /etc/profile
export PATH=$PATH:$JAVA_HOME/bin:**/usr/local/imagemagick/bin**
source /etc/profile
8.测试(可选)
convert test.jpg a.jpg -geometry +75+180 -composite f_over.jpg
convert -background none -fill white -pointsize 36 label:A label_A_white.png
以上是关于php安装imagemagick扩展的主要内容,如果未能解决你的问题,请参考以下文章
linux centos8.1下PHP安装 Imagick扩展
php安装imagemagick扩展 常见问题与解决方案(win平台)