Wednesday, February 29

Installing ImageMagick for PHP after the downgrade

Sadly the ppa repository does not have lots of packages, one of the best for image treatment is imagemagick, first we need to install the dependencies

$ sudo apt-get install php-pear imagemagick php5-dev libmagickwand-dev


Then all we need to do is install the extension using pecl

$ sudo pecl install --alldeps imagick


Now we need to add the image magick library to php, create the file imagick.ini

$ sudo vi /etc/php5/conf.d/imagick.ini


And put this code

extension=imagick.so


save the file and see if the extension gets loaded

$ php -m | grep imagick


also, don't forget to restart apache
$ sudo service apache2 restart