» Class 'Imagick' not found

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.

You probably shouldn't follow me


Like this Article?

I'd appreciate it if you leave a comment, spread the word, or consider a small donation


tags: php, imagick, imagemagick, PECL
category: Howto - Webserver
read: 28,072 times

Add comment

(required, shown)(required, not shown)for syntax highlighting

[CODE="Javascript"]
your_code_here();
[/CODE]

Replace "Javascript"
with "php", "text", etc.
code (to make sure you are not a spammer)

 Track replies: rss feed comments feed

Comments

#25. joop on 02 September 2011

Gravatar.com: joopthanks!

#24. Bill B on 15 June 2011

Gravatar.com: Bill BI tried the listed commands, and double checked that php5-dev was installed and:

# pecl install imagick
...

... [more] 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

#23. Iyngaran Iyathurai on 14 February 2011

Gravatar.com: Iyngaran IyathuraiGreat work. This article help me to sort the issue.

#22. Kevin on 12 August 2010

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

#21. Marek on 02 August 2010

Gravatar.com: MarekHow 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?

#20. Davide on 13 November 2009

Gravatar.com: DavideThanks for this article.. This lines solve my problems!

#19. nabab on 26 May 2009

Gravatar.com: nababBrilliant, thanks!

#18. nono on 08 April 2009

Gravatar.com: nono* via apt-get

#17. nono on 08 April 2009

Gravatar.com: nonothanks. for other readers, you may also need to install php5-dev if youre getting pecl errors.

#16. Christophe Hubert on 23 March 2009

Gravatar.com: Christophe HubertThank you Kevin. I had this problem on Debian ETCH, php5

#15. megar on 06 February 2009

Gravatar.com: megarThank you, it works perfectly !

#14. srini on 22 November 2008

Gravatar.com: srinigreat post..check this one as well

http://thinktibits.blogspot.com/2008/09/installing-imagemagick-on-windows-setup.html

#13. insanet on 12 September 2008

Gravatar.com: insanetthis worked perfectly for me too, thank you very much.

#12. Steve Spiller on 29 July 2008

Default avatar:Steve SpillerMade me look like I actually knew what I was doing! Thanks

#11. andi on 09 July 2008

Default avatar:andigreat post.. it helped me solve the problem on debian etch.. thanks a lot..!

#10. Michael on 12 June 2008

Default avatar:MichaelWorks fine here tool! Thanks alot! :)

#9. Bhavin on 10 June 2008

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

#8. Benjamin on 03 June 2008

Default avatar:Benjaminwe had the same problem on debian etch - your solution worked perfectly - thanks!

#7. Kevin on 20 May 2008

Default avatar:Kevin@ jf: Thanks for sharing!

#6. jf on 20 May 2008

Default avatar:jfworked fine here too . (fresh hardy install) thanks for the tip!

#5. yassine on 09 May 2008

Default avatar:yassineThat's ingenious!
it help me a lot.

#4. Kevin on 08 May 2008

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

#3. tony on 07 May 2008

Default avatar:tonyi have the same prob on a windows machine. any idea how to fix it ?

#2. A.W. on 02 May 2008

Default avatar:A.W.This saved my coffe break :)

Thanks!

#1. Radek Hulán on 29 April 2008

Default avatar:Radek HulánWorked great on 8.04 x64. Thank you :)