Installing Imagick for PHP on Ubuntu through PECL
I need to work with editing some images programatically and have always favored ImageMagick over GD (to be fair, I haven’t used GD in at least 3 years). In the past, I used php to pipe commands to the command line via exec(), which never felt right. I remember seeing some development work on an extension on planet-php.com, and after some searching landed on the Imagick extension for PHP. I tried to install is via sudo pecl install imagick , but ran into errors when I tried to find MagickWand-config, which I think is basically the API for PHP to ImageMagick. Reading the comments on php.net, and I was able to install it. Apparently I was missing libmagick9-dev. I didn’t need to add the imagemagick.so, as the ini file was already in /etc/php5/apache2/conf.d.
Now I just have to familiarize myself with the class (And it is a class, not just some functions
).One of the authors of the extension, Mikko, has some great tutorials on his blog. Just need to get some free time to read and play with it. But this is much better than building a huge command to execute via exec()!