Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Installing Imagick with PHP 7

1. Download the phpseven branch of the imagick repository

git clone https://github.com/mkoppanen/imagick.git imagick

2. phpize for target PHP version

cd imagick && /path/to/php7/bin/phpize && ./configure && make && make install

3. Enable the extension for your PHP version

echo "extension=imagick.so" >> /path/to/php.ini

4. Restart PHP / Apache (I run php-fpm)

For php-fpm:

service php5-fpm restart

For apache, something like:

sudo apache2ctl graceful

@fyrebase

This comment has been minimized.

Copy link

commented Dec 11, 2015

The above git clone command didn't work for me. I had to git clone https://github.com/mkoppanen/imagick.git and switch to the phpseven branch.

@bossanova808

This comment has been minimized.

Copy link

commented Jan 15, 2016

It's also important to run configure with the correct php-config so e.g. on severpilot managed serves ./configure --with-php-config=/opt/sp/php7.0/bin/php-config

I also had to sudo apt-get install libmagickwand-dev libmagickcore-dev along the way

@avatec

This comment has been minimized.

Copy link

commented Apr 12, 2019

Mojavie: ./php_imagick_defs.h:25:12: fatal error: 'MagickWand/MagickWand.h' file not found

include <MagickWand/MagickWand.h>

       ^~~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.
make: *** [imagick_file.lo] Error 1

Headers installed, trying also sudo peel install imagick - without results. PHP 7.1.23

@mirko77

This comment has been minimized.

Copy link

commented Apr 24, 2019

Same error as @avatec

@avatec

This comment has been minimized.

Copy link

commented Apr 24, 2019

@mirko77 check my reply: https://stackoverflow.com/questions/11865600/imagemagick-brew-installation-with-php-module-in-mac-os-x/55656378#55656378

I've found solution and compile imagick using my method. Look at third answer (Grzegorz)

@mirko77

This comment has been minimized.

Copy link

commented Apr 24, 2019

@avatec many thanks, I managed to install it using one of the methods mentioned among the answers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.