1. Download the phpseven branch of the imagick repository
git clone https://github.com/mkoppanen/imagick.git imagick
2. phpize for target PHP version
cd imagick && /path/to/php7/bin/phpize && ./configure && make && make install
3. Enable the extension for your PHP version
echo "extension=imagick.so" >> /path/to/php.ini
4. Restart PHP / Apache (I run php-fpm)
For php-fpm:
service php5-fpm restart
For apache, something like:
sudo apache2ctl graceful
The above git clone command didn't work for me. I had to
git clone https://github.com/mkoppanen/imagick.git
and switch to thephpseven
branch.