How to install ImageMagick library and php extension on Ubuntu?
I was working on a symfony2 project in which I have to place watermark on images. I used ImageMagicK extension, it’s called as Imagick in PHP. I had found some difficulties while installation and then successfully installed. So I am sharing that procedure here.
- Get the package from pecl site for Imagick package. Following is the URL https://pecl.php.net/package/imagick
- Download it by wget command. I used following package.
3. Unzip the downloaded file by following command.
tar xvf imagick-3.4.4RC2.tgz
4. Then go to the extracted folder.
Then following commands. Phpize command is used to prepare a build environment for PHP extension.
phpize ./configure make make install
After running last command extension will be installed and added to php.ini file. If its not added then you will need to add it in php.ini file.
Then at the end just restart apache.
sudo service apache2 restart
To check if imagick installed successfully, you can run following command. This will show list of modules that are installed. After installation imaick should be listed there.