install imagick for php7.2 code example
Example: install imagick php ubuntu
#install imagick
sudo apt-get install php-imagick
#check if installed
php -m | grep imagick
#restart your web server
sudo service apache2 restart
or
sudo service nginx restart