Skip to content

Laravel Forge

How to setup ImageMagick 7 and the Imagick PHP extension on Laravel Forge.

Ubuntu 24.04

Install

sh
ssh forge@YOUR_SERVERS_PUBLIC_IP_ADDRESS
sh
sudo phpdismod imagick
sudo apt remove -y php8.3-imagick
sudo service php8.3-fpm restart
sudo apt remove -y imagemagick-6-common
wget -qO - https://vintagesucks.github.io/ppa/key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/vintagesucks-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/vintagesucks-keyring.gpg] https://vintagesucks.github.io/ppa/ubuntu/noble ./" | sudo tee /etc/apt/sources.list.d/vintagesucks-noble.list
sudo apt update && sudo apt install -y imagemagick
curl -o imagick.tgz https://pecl.php.net/get/imagick
printf "\n" | MAKEFLAGS="-j $(nproc)" sudo pecl upgrade --force ./imagick.tgz
rm imagick.tgz
sudo phpenmod imagick
sudo service php8.3-fpm restart
sh
php -r 'phpinfo();' | grep -i "ImageMagick"

Update

sh
ssh forge@YOUR_SERVERS_PUBLIC_IP_ADDRESS
sh
sudo apt update && sudo apt install imagemagick
curl -o imagick.tgz https://pecl.php.net/get/imagick
printf "\n" | MAKEFLAGS="-j $(nproc)" sudo pecl upgrade --force ./imagick.tgz
rm imagick.tgz
sudo service php8.3-fpm restart
sh
php -r 'phpinfo();' | grep -i "ImageMagick"