Howto: Install Imagick (for php) on Ubuntu 11.10
Solution 1
The package has a different name in Ubuntu.
sudo apt-get install php5-imagick
The error with building via PECL means you must install libmagickwand-dev, libmagickcore3, libmagickwand3
probably (there are alternatives: graphicsmagick-imagemagick-compat
, see Synaptic).
Solution 2
Installation steps for Ubuntu 12.04:
Install imagemagick
sudo apt-get install imagemagick
Install imagemagick PECL extension
sudo apt-get install php5-imagick
Restart webserver
Solution 3
Installation steps for Ubuntu < 16.04:
sudo apt-get install imagemagick php5-imagick; sudo service apache2 restart
Installation steps for Ubuntu > 16.04:
sudo apt-get install imagemagick php-imagick; sudo service apache2 restart
Solution 4
For Ubuntu 16 or later:
sudo apt-get install php-imagick
(note the use of php-
instead of php5-
)
Solution 5
Install imagemagick with :
sudo apt-get install imagemagick
Install imagemagick PECL extension :
sudo apt-get install php5-imagick
Restart webserver
DJSunny
Updated on March 14, 2020Comments
-
DJSunny about 4 years
I'm attempting to install ImagicK as its required for a Yii Extension I want to use for my project.
I've checked around and followed a few different suggestions but nothing that has worked so far, ultimately the framework extension is still throwing me an error (Must have ImagicK installed).
I've tried things like:
sudo apt-get update sudo apt-get install imagick-php5 .. etc
as well as the PECL install which ends up throwing me the following error:
Checking ImageMagick MagickWand API configuration program... configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
Any help as to how to get ImagicK installed and integrated with PHP on Ubuntu 11.10 would be great.
Thanks in advance!
-
mario over 11 yearsNot usally. You may wish to check
/etc/php5/conf.d/
. But installing such a package ought to add an uncommented directive there. -
SSH This over 11 yearsSorry, I was actually doing something else wrong, but thanks for the info!
-
user2867288 almost 10 yearsThumbs up for not assuming I already had imagemagick installed.
-
jmadsen about 9 yearsyou should also mention that a webserver restart seems to be required
-
Jimbali over 8 yearsIn my case I had to do
sudo service nginx restart
andsudo service php5-fpm restart
. -
johnRivs over 7 yearsYou wrote the same thing twice.
-
Nico over 7 yearsIf you are using php 5.6, then you need to do
sudo apt-get install php5.6-imagick
. And for nginx and php-fpm:sudo service nginx restart
andsudo service php5.6-fpm restart
-
Papotitu almost 7 years
sudo apt-get install php5.6-imagick
now for Ubuntu 16.04 and upper -
Matiss over 6 years
sudo apt-get install imagemagick php-imagick
for Ubuntu 16.04 -
bdombro almost 4 yearsActually, they are different. Notice that one has
php5-imagick
and the otherphp-imagick