Quick Tip: Restart after installing ImageMagick

Codeaholics Code-blog
SeanColombo.com

ImageMagick is a very useful suite of command-line tools for modifying images. I’ve used it in the past to do several things including the creation of thumbnails for doItLater.com (NSFW… it’s like CollegeHumor.com) and now I’m using it for another project. After installing ImageMagick on my Windows XP SP2 development box running Apache 2 and PHP 5, I realized that I could get convert, mogrify, and other ImageMagick tools to work just fine from the command line but not from PHP using exec().

I spent a lot of time debugging this, trying to get return vals from the exec() call. After a lot of wasted time, and trips to several forums, I found burried at the very bottom of a long forum discussion, that in the end all that fixed it was restarting. No amount of calls to system(), popen(), or setting of environment variables helped prior. I restarted… now it works for me too.

So to sum it up: If you just installed ImageMagick and you can’t get ImageMagick to work from PHP using exec() or something similar, restart your computer and it will probably work..

Leave a Reply

Your email address will not be published. Required fields are marked *