Install Imagick for PHP 7.2 on Ubuntu 18.04
Mike Bronner • May 28, 2019devops
I use Imagick for many of my web application projects. It is a robust and powerful image manipulation tool that has some advantages over GD. Unfortunately it doesn't come installed by default in Homestead.
- SSH into your Homestead instance.
- Run the following command:
sudo -i apt update -y apt install php-imagick -y echo extension=imagick.so >> /etc/php/7.2/cli/php.ini echo extension=imagick.so >> /etc/php/7.2/fpm/php.ini service php7.2-fpm reload
If you would like to enable processing of PDFs in Imagick (it is now disabled by default), perform the following configuration after running the above command, while still in
- Edit the Iaptmagick configuration file:
Enable PDF editing, change
<policy domain="coder" rights="none" pattern="PDF" />
<policy domain="coder" rights="read|write" pattern="PDF" />
That should do it!