参考文章:
http://php.net/manual/zh/imagick.installation.php
http://www.imagemagick.org/script/install-source.php
1、ImageMagick安装
下载地址:
wget https://www.imagemagick.org/download/ImageMagick.tar.gz
sourceforge.net/projects/imagemagick/files/
Unpack the distribution with this command:
tar xvzf ImageMagick.tar.gz
Next configure and compile ImageMagick:
$ cd ImageMagick-7.0.7 $ ./configure $ make
If ImageMagick configured and compiled without complaint, you are ready to install it on your system. Administrator privileges are required to install. To install, type
sudo make install
You may need to configure the dynamic linker run-time bindings:
sudo ldconfig /usr/local/lib
Finally, verify the ImageMagick install worked properly, type
/usr/local/bin/convert logo: logo.gif
2、install Imagick.so
下载地址:
pecl.php.net/package/imagick/download
wget http://pecl.php.net/get/imagick-3.4.3.tgz
Unpack the tar file and then enter the commands in quotes in terminal:
1. "cd imagick-2.2.3" - go where you placed the folder
2. "phpize" //phpize为php工具 针对lampp /opt/lampp/bin/phpize 如提示Cannot find autoconf,yum isntall autoconf
3. "./configure --with-php-config=/opt/lampp/bin/php-config" //针对lampp
4. "make"
5. "make install"
Then, for PHP to honor the the extension, add the following line to the
extensions section of your php.ini file:
extension="imagick.so"
restart apache