kvz.io
Published on

Class 'Imagick' Not Found

Authors
  • avatar
    Name
    Kevin van Zonneveld
    Twitter
    @kvz

I tried to do some Image Magick with PHP recently on an Ubuntu Feisty machine, and even though I had the required package: 'php5-imagick' installed, and I updated my php.ini with imagick.so, I kept getting the error Class 'Imagick' not found. This is how I eventually fixed it.

The idea is to fall back to the good old PECL installation:

sudo aptitude install make php5-dev php-pear
sudo aptitude remove php5-imagick
sudo aptitude install libmagick9-dev
sudo pecl install imagick
sudo /etc/init.d/apache2 restart

And don't forget to put your imagick.so in your php.ini!

Well, that did it for me. No need for a long article this time, but this may help others experiencing similar problems.

Legacy Comments (25)

These comments were imported from the previous blog system (Disqus).

Radek Hulán
Radek Hulán·

Worked great on 8.04 x64. Thank you :)

A.W.
A.W.·

This saved my coffe break :)

Thanks!

tony
tony·

i have the same prob on a windows machine. any idea how to fix it ?

Kevin
Kevin·

@ tony: Can\'t you use PECL on windows as well? I always believed it was platform independent.

yassine
yassine·

That\'s ingenious!
it help me a lot.

jf
jf·

worked fine here too . (fresh hardy install) thanks for the tip!

Kevin
Kevin·

@ jf: Thanks for sharing!

Benjamin
Benjamin·

we had the same problem on debian etch - your solution worked perfectly - thanks!

Bhavin
Bhavin·

I got the same error while uploading images with the imagick.
Lets hope this can solve my problem!
Thank you.

Michael
Michael·

Works fine here tool! Thanks alot! :)

andi
andi·

great post.. it helped me solve the problem on debian etch.. thanks a lot..!

Steve Spiller
Steve Spiller·

Made me look like I actually knew what I was doing! Thanks

insanet
insanet·

this worked perfectly for me too, thank you very much.

srini
srini·

great post..check this one as well

http://thinktibits.blogspot...

megar
megar·

Thank you, it works perfectly !

Christophe Hubert
Christophe Hubert·

Thank you Kevin. I had this problem on Debian ETCH, php5

nono
nono·

thanks. for other readers, you may also need to install php5-dev if youre getting pecl errors.

nono
nono·

* via apt-get

nabab
nabab·

Brilliant, thanks!

Davide
Davide·

Thanks for this article.. This lines solve my problems!

Marek
Marek·

How does one enter the binary information in PHP script as my web site provider does compile IM with PHP. I have it installed on the server but need to reference the installation location in PHP somehow. Any clues?

Kev van Zonneveld
Kev van Zonneveld·

@ Marek: That sounds very specific and you should just take it up with your provider.

Iyngaran Iyathurai
Iyngaran Iyathurai·

Great work. This article help me to sort the issue.

Bill B
Bill B·

I tried the listed commands, and double checked that php5-dev was installed and:

# pecl install imagick
...

running: phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

ERROR: `phpize' failed

joop
joop·

thanks!