One: Install Imagick extension under windows

1. Download Imagick

Imagick download address imagick extension download address

2. Install Imagick

[1] Unzip the downloaded installation package and then copy php_imagick.dll to your php/etc directory, and copy other files ending with dll to the php directory
[2] Open the php.ini file to add
 extension=php_imagick.dll
[3] Restart Apache and execute php -m

image.png
When using the prompt ImageMagick number of supported formats is 0, you need to install imagemagick

3. imagemagick installation

imagemagick download address: imagemagick download address
Unzip the downloaded imagemagick file to the C:\Program Files (x86) directory, add C:\Program Files (x86)\ImageMagick\bin to the system environment variable path and then add C:\Program Files (x86)\ImageMagick Copy all the files ending with dll in the \bin directory to the php directory. If prompted repeatedly, click skip, restart Apache after the copying is complete, and the imagick extension installation of php is completed.

Two: Install Imagick extension under linux

1. Install ImageMagick

[1]: ImageMagick download address: imagemagick download address
 wget http://www.imagemagick.org/download/ImageMagick.tar.gz
[2]: Unzip installation
 tar zxvf ImageMagick.tar.gz
cd ImageMagick-7.0.8-16/
./configure --prefix=/usr/local/imagemagick
make && make install

2. Install the imagick extension

[1]: Download imagick address: imagick download address
 wget https://pecl.php.net/get/imagick-3.4.3.tgz
[2]: Install Imagick
 tar zxvf imagick-3.4.3.tgz  #解压
cd imagick-3.4.3/
/usr/local/php/bin/phpize   #用phpize生成
ln -s /usr/local/imagemagick/include/ImageMagick-7 /usr/local/imagemagick/include/ImageMagick   #ImageMagick 6.8以上版本为/usr/local/include/ImageMagick-X,在configure之前先做下软连接
./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/imagemagick  #编译
make && make install  #安装

Solve the problems that may be encountered in the installation of the PHP imagick extension:
configure passed, there was an error error when make: wand/MagickWand.h: No such file or directory
Solution

 yum install gtk2-devel
export PKG_CONFIG_PATH=/usr/local/imagemagick/lib/pkgconfig/

then reinstall imagick

[3]: Modify php.ini configuration

If you don't know where php.ini is, use the following command to find the php.ini address

 find / -name php.ini

add to php.ini

 extension=imagick.so

restart nginx

 /usr/local/nginx/sbin/nginx -s reopen

So the Imagick extension is installed successfully


huaweichenai
673 声望114 粉丝