ServerAvatar

How to install PHP imagemagick extension

Imagemagick

PHP imagemagick extension is used to modify and create images using imagemagick API. Some WordPress plugins or some packages might require you to have PHP imagemagick installed in your configuration.

By default, ServerAvatar does not install imagemagick PHP extension on your servers. To install the module, Just follow this tutorial. It’s very easy and it does not require you to have too much knowledge of Linux or system administration.

First of all, Connect with your server using SSH. If you are using Ubuntu or Mac, Just open up the terminal and type the following command.

ssh root@IP_ADDRESS

Logging in as a root user is not required. However, You need root privileges to install new packages. So, If you are not logging in as a root, Log in with a user having sudo privileges.

Once logged in, Just execute the following commands to install PHP imagemagick extension on your server.

sudo apt-get install make autoconf gcc pkg-config

sudo apt-get install libmagickwand-dev php-imagick

Installation might take few minutes as it will install tens of new packages on which these packages might depend. Once the installation is done, PHP imagemagick is installed on the server.

But it won’t work until we activate the extension in PHP configuration. To enable the PHP imagemagick extension, just execute the following command in the terminal.

sudo phpenmod imagick

You would not get any output of the command but we can verify if the extension is enabled successfully or not. If you don’t get any output, The extension is enabled successfully. To save changes, Restart PHP by using the following command.

sudo service php7.0-fpm restart

To verify the installation of php imagemagick extension, Execute the following command and you can expect output as follows.

php7.0 -i | grep imagick

Output:

imagick
imagick module => enabled
imagick module version => 3.4.0RC6
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
imagick.locale_fix => 0 => 0
imagick.progress_monitor => 0 => 0
imagick.skip_version_check => 0 => 0

If you are using a different version of PHP, Just replace 7.0 with the version you are using. For example, If you are using PHP5.6, Execute the command php5.6 -i | grep imagick.

So, this is how you can install PHP imagemagick extension in your configuration. If you are a ServerAvatar user, You can just create a ticket and we will install it for you in case you don’t want to mess with the configuration.

If you are facing any issue following this tutorial, let us know in the comment section, we will help you install the extension in your configuration.

  • Guide

    How to Fix DNS_PROBE_FINISHED_NXDOMAIN Error

    By Meghna Meghwani

    Have you ever seen a DNS_PROBE_FINISHED_NXDOMAIN in browser? We usually begin by verifying the website URL, then try accessing it on another device, through a different network, or in an incognito browser window to identify the possible cause of the issue. That quick steps helps to decide whether to troubleshoot your device or the website’s…

  • Guide

    How to Reduce Cache Misses and Improve Application Performance

    By Meghna Meghwani

    A cache is supposed to remove work. Yet an application can have Redis installed, a CDN enabled, and a page-cache plugin active while still rebuilding the same responses again and again. To reduce cache misses, you must ensure the application can consistently reuse cached data. The problem usually isn’t a missing cache, it’s a cache…

  • WordPress

    How to Send Emails From WordPress Using Gmail SMTP for Free

    By Meghna Meghwani

    WordPress may show a reassuring “message sent” notice even when no email reaches the recipient. That gap is frustrating when the missing message is a password reset, contact-form notification, new-account email, or order receipt. WordPress Gmail SMTP provides a reliable way to send emails through Email’s SMTP server instead of relying on your web host’s…

Risk free

Deploy your first appin 10 minutes.

Connect a server, pick an application and go live, with SSL and backups already in place.

  • No credit card required
  • Free 4-day trial
  • Deploy in the next 10 minutes