How to install Imagick on Oracle Linux 9.3
To Install Imagick On Oracle Linux 9.3
Introduction:
ImageMagick, invoked from the command line as magick, is a free and open-source cross-platform software suite for displaying, creating, converting, modifying, and editing raster images. It also can read and write over 200 image file formats and is widely used in open-source applications.
Procedure
Step 1: Check the OS version by using the below command
[root@linuxhelp ~]# cat /etc/oracle-release
NAME="Oracle Linux Server"
VERSION="9.3"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="9.3"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Oracle Linux Server 9.3"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:9:3:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://github.com/oracle/oracle-linux"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 9"
ORACLE_BUGZILLA_PRODUCT_VERSION=9.3
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=9.3
Step 2: Install Apache and PHP by using the below command
[root@linuxhelp ~]# dnf install -y httpd php-fpm
Last metadata expiration check: 0:18:34 ago on Wednesday 14 February 2024 01:34:32 PM.
Dependencies resolved.
======================================================================================================================================================================================================
Package Architecture Version Repository Size
======================================================================================================================================================================================================
Installing:
httpd x86_64 2.4.57-5.0.1.el9 ol9_appstream 65 k
php-fpm x86_64 8.0.30-1.el9_2 ol9_appstream 1.6 M
Installing dependencies:
apr x86_64 1.7.0-12.el9_3 ol9_appstream 131 k
apr-util x86_64 1.6.1-23.el9 ol9_appstream 99 k
apr-util-bdb x86_64 1.6.1-23.el9 ol9_appstream 12 k
httpd-core x86_64 2.4.57-5.0.1.el9 ol9_appstream 1.8 M
httpd-filesystem noarch 2.4.57-5.0.1.el9 ol9_appstream 12 k
httpd-tools x86_64 2.4.57-5.0.1.el9 ol9_appstream 94 k
nginx-filesystem noarch 1:1.20.1-14.0.1.el9_2.1 ol9_appstream 8.4 k
oracle-logos-httpd noarch 90.2-1.0.4.el9 ol9_baseos_latest 37 k
php-common x86_64 8.0.30-1.el9_2 ol9_appstream 714 k
Installing weak dependencies:
apr-util-openssl x86_64 1.6.1-23.el9 ol9_appstream 14 k
mod_http2 x86_64 1.15.19-5.el9 ol9_appstream 157 k
mod_lua x86_64 2.4.57-5.0.1.el9 ol9_appstream 59 k
Transaction Summary
======================================================================================================================================================================================================
Install 14 Packages
Total download size: 4.7 M
Installed size: 22 M
Downloading Packages:
(1/14): oracle-logos-httpd-90.2-1.0.4.el9.noarch.rpm 192 kB/s | 37 kB 00:00
(2/14): apr-util-bdb-1.6.1-23.el9.x86_64.rpm 1.0 MB/s | 12 kB 00:00
(3/14): apr-util-1.6.1-23.el9.x86_64.rpm 455 kB/s | 99 kB 00:00
(4/14): apr-util-openssl-1.6.1-23.el9.x86_64.rpm 966 kB/s | 14 kB 00:00
(5/14): apr-1.7.0-12.el9_3.x86_64.rpm 540 kB/s | 131 kB 00:00
(6/14): httpd-2.4.57-5.0.1.el9.x86_64.rpm 1.8 MB/s | 65 kB 00:00
(7/14): httpd-filesystem-2.4.57-5.0.1.el9.noarch.rpm 914 kB/s | 12 kB 00:00
(8/14): httpd-tools-2.4.57-5.0.1.el9.x86_64.rpm 3.2 MB/s | 94 kB 00:00
(9/14): mod_http2-1.15.19-5.el9.x86_64.rpm 3.4 MB/s | 157 kB 00:00
(10/14): mod_lua-2.4.57-5.0.1.el9.x86_64.rpm 2.7 MB/s | 59 kB 00:00
(11/14): httpd-core-2.4.57-5.0.1.el9.x86_64.rpm 16 MB/s | 1.8 MB 00:00
(12/14): nginx-filesystem-1.20.1-14.0.1.el9_2.1.noarch.rpm 352 kB/s | 8.4 kB 00:00
(13/14): php-common-8.0.30-1.el9_2.x86_64.rpm 13 MB/s | 714 kB 00:00
(14/14): php-fpm-8.0.30-1.el9_2.x86_64.rpm 22 MB/s | 1.6 MB 00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 11 MB/s | 4.7 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : apr-1.7.0-11.el9.x86_64 1/14
Installing : apr-util-bdb-1.6.1-20.el9_2.1.x86_64 2/14
Installing : apr-util-openssl-1.6.1-20.el9_2.1.x86_64 3/14
Installing : apr-util-1.6.1-20.el9_2.1.x86_64 4/14
Running scriptlet: httpd-filesystem-2.4.53-11.0.1.el9_2.5.noarch 5/14
Installing : httpd-filesystem-2.4.53-11.0.1.el9_2.5.noarch 5/14
Installing : httpd-tools-2.4.53-11.0.1.el9_2.5.x86_64 6/14
Installing : httpd-core-2.4.53-11.0.1.el9_2.5.x86_64 7/14
Installing : mod_http2-1.15.19-4.el9_2.4.x86_64 8/14
Installing : mod_lua-2.4.53-11.0.1.el9_2.5.x86_64 9/14
Installing : php-common-8.0.27-1.el9_1.x86_64 10/14
Running scriptlet: nginx-filesystem-1:1.20.1-14.0.1.el9.noarch 11/14
Installing : nginx-filesystem-1:1.20.1-14.0.1.el9.noarch 11/14
Installing : oracle-logos-httpd-90.2-1.0.3.el9.noarch 12/14
Installing : httpd-2.4.53-11.0.1.el9_2.5.x86_64 13/14
Running scriptlet: httpd-2.4.53-11.0.1.el9_2.5.x86_64 13/14
Installing : php-fpm-8.0.27-1.el9_1.x86_64 14/14
Running scriptlet: php-fpm-8.0.27-1.el9_1.x86_64 14/14
Running scriptlet: httpd-2.4.53-11.0.1.el9_2.5.x86_64 14/14
Running scriptlet: php-fpm-8.0.27-1.el9_1.x86_64 14/14
Verifying : oracle-logos-httpd-90.2-1.0.3.el9.noarch 1/14
Verifying : apr-1.7.0-11.el9.x86_64 2/14
Verifying : apr-util-1.6.1-20.el9_2.1.x86_64 3/14
Verifying : apr-util-bdb-1.6.1-20.el9_2.1.x86_64 4/14
Verifying : apr-util-openssl-1.6.1-20.el9_2.1.x86_64 5/14
Verifying : httpd-2.4.53-11.0.1.el9_2.5.x86_64 6/14
Verifying : httpd-core-2.4.53-11.0.1.el9_2.5.x86_64 7/14
Verifying : httpd-filesystem-2.4.53-11.0.1.el9_2.5.noarch 8/14
Verifying : httpd-tools-2.4.53-11.0.1.el9_2.5.x86_64 9/14
Verifying : mod_http2-1.15.19-4.el9_2.4.x86_64 10/14
Verifying : mod_lua-2.4.53-11.0.1.el9_2.5.x86_64 11/14
Verifying : nginx-filesystem-1:1.20.1-14.0.1.el9.noarch 12/14
Verifying : php-common-8.0.27-1.el9_1.x86_64 13/14
Verifying : php-fpm-8.0.27-1.el9_1.x86_64 14/14
Installed:
apr-1.7.0-11.el9.x86_64
apr-util-1.6.1-20.el9_2.1.x86_64
apr-util-bdb-1.6.1-20.el9_2.1.x86_64
apr-util-openssl-1.6.1-20.el9_2.1.x86_64
httpd-2.4.53-11.0.1.el9_2.5.x86_64
httpd-core-2.4.53-11.0.1.el9_2.5.x86_64
httpd-filesystem-2.4.53-11.0.1.el9_2.5.noarch
httpd-tools-2.4.53-11.0.1.el9_2.5.x86_64
mod_http2-1.15.19-4.el9_2.4.x86_64
mod_lua-2.4.53-11.0.1.el9_2.5.x86_64
nginx-filesystem-1:1.20.1-14.0.1.el9.noarch
oracle-logos-httpd-90.2-1.0.3.el9.noarch
php-common-8.0.27-1.el9_1.x86_64
php-fpm-8.0.27-1.el9_1.x86_64
Complete!
Step 3: Enable and Start Apache and PHP services by using the below command
[root@linuxhelp ~]# systemctl enable --now httpd php-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.
[root@linuxhelp ~]# systemctl start --now httpd php-fpm
Step 4: Allow HTTP service in Firewall and reload the firewall by using the below command
[root@linuxhelp ~]# firewall-cmd --permanent --add-service=http
success
[root@linuxhelp ~]# firewall-cmd --reload
Success
Step 5: Install EPEL repository by using dnf command.
[root@linuxhelp ~]# dnf install -y epel-release
Last metadata expiration check: 0:20:27 ago on Wednesday 14 February 2024 01:34:32 PM.
Dependencies resolved.
======================================================================================================================================================================================================
Package Architecture Version Repository Size
======================================================================================================================================================================================================
Installing:
oracle-epel-release-el9 x86_64 1.0-1.el9 ol9_baseos_latest 14 k
Installing dependencies:
yum-utils noarch 4.3.0-11.0.1.el9_3 ol9_baseos_latest 53 k
Transaction Summary
======================================================================================================================================================================================================
Install 2 Packages
Total download size: 67 k
Installed size: 41 k
Downloading Packages:
(1/2): oracle-epel-release-el9-1.0-1.el9.x86_64.rpm 89 kB/s | 14 kB 00:00
(2/2): yum-utils-4.3.0-11.0.1.el9_3.noarch.rpm 333 kB/s | 53 kB 00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 405 kB/s | 67 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : yum-utils-4.3.0-11.0.1.el9_3.noarch 1/2 Installing : oracle-epel-release-el9-1.0-1.el9.x86_64 2/2
Running scriptlet: oracle-epel-release-el9-1.0-1.el9.x86_64 2/2
Verifying : oracle-epel-release-el9-1.0-1.el9.x86_64 1/2
Verifying : yum-utils-4.3.0-5.0.2.el9_2.noarch 2/2
Installed:
oracle-epel-release-el9-1.0-1.el9.x86_64 yum-utils-4.3.0-5.0.2.el9_2.noarch
Complete!
Step 6: Build the yum cache for newly installed yum repositories by using the below command.
[root@linuxhelp ~]# dnf makecache
Oracle Linux 9 EPEL Packages for Development (x 19 MB/s | 45 MB 00:02
Oracle Linux 9 BaseOS Latest (x86_64) 1.7 kB/s | 3.6 kB 00:02
Oracle Linux 9 Application Stream Packages (x86 28 kB/s | 3.9 kB 00:00
Oracle Linux 9 UEK Release 7 (x86_64) 24 kB/s | 3.0 kB 00:00
Metadata cache created.
Step 7: Install ImageMagick by using the below command.
[root@linuxhelp ~]# dnf install -y ImageMagick ImageMagick-devel
Last metadata expiration check: 0:00:11 ago on Wednesday 14 February 2024 01:56:34 PM.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
ImageMagick x86_64 6.9.12.93-1.el9 ol9_developer_EPEL 107 k
ImageMagick-devel x86_64 6.9.12.93-1.el9 ol9_developer_EPEL 238 k
Installing dependencies:
ImageMagick-libs x86_64 6.9.12.93-1.el9 ol9_developer_EPEL 2.6 M
LibRaw x86_64 0.20.2-5.el9 ol9_appstream 382 k
graphviz x86_64 2.44.0-25.el9 ol9_appstream 3.4 M
gtk2 x86_64 2.24.33-8.el9 ol9_appstream 3.6 M
ibus-gtk2 x86_64 1.5.25-2.el9 ol9_appstream 26 k
imath x86_64 3.1.2-1.el9 ol9_appstream 102 k
openexr-libs x86_64 3.1.1-2.el9 ol9_appstream 1.1 M
xorg-x11-fonts-ISO8859-1-100dpi
noarch 7.5-33.el9 ol9_appstream 1.2 M
Installing weak dependencies:
adwaita-gtk2-theme x86_64 3.28-14.el9 ol9_appstream 495 k
libcanberra-gtk2 x86_64 0.30-26.el9 ol9_appstream 26 k
Transaction Summary
================================================================================
Install 18 Packages
Total download size: 14 M
Installed size: 44 M
Downloading Packages:
(1/18): ImageMagick-6.9.12.93-1.el9.x86_64.rpm 352 kB/s | 107 kB 00:00
(2/18): liblqr-1-0.4.2-19.el9.x86_64.rpm 1.2 MB/s | 53 kB 00:00
Verifying : openexr-libs-3.1.1-2.el9.x86_64 17/18
Verifying : xorg-x11-fonts-ISO8859-1-100dpi-7.5-33.el9.noarch 18/18
Installed:
ImageMagick-6.9.12.93-1.el9.x86_64
ImageMagick-devel-6.9.12.93-1.el9.x86_64
ImageMagick-libs-6.9.12.93-1.el9.x86_64
LibRaw-0.20.2-5.el9.x86_64
adwaita-gtk2-theme-3.28-14.el9.x86_64
graphviz-2.44.0-25.el9.x86_64
gtk2-2.24.33-8.el9.x86_64
ibus-gtk2-1.5.25-2.el9.x86_64
openexr-libs-3.1.1-2.el9.x86_64
xorg-x11-fonts-ISO8859-1-100dpi-7.5-33.el9.noarch
Complete!
Step 8: Check the installed version of ImageMagick by using the below command.
[root@linuxhelp ~]# Magick-config --version
6.9.12-93 Q16
Step 9: Install PHP Imagick by using the below command
[root@linuxhelp ~]# dnf install -y php-devel php-pear make
Last metadata expiration check: 0:01:51 ago on Wednesday 14 February 2024 01:56:34 PM.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
make x86_64 1:4.3-7.el9 ol9_baseos_latest 571 k
php-devel x86_64 8.0.27-1.el9_1 ol9_appstream 971 k
php-pear noarch 1:1.10.13-1.el9 ol9_appstream 489 k
Installing dependencies:
autoconf noarch 2.69-38.el9 ol9_appstream 741 k
automake noarch 1.16.2-6.el9 ol9_appstream 794 k
binutils x86_64 2.35.2-37.0.2.el9 ol9_baseos_latest 4.8 M
binutils-gold x86_64 2.35.2-37.0.2.el9 ol9_baseos_latest 739 k
cmake-filesystem x86_64 3.20.2-8.el9 ol9_appstream 11 k
gcc x86_64 11.3.1-4.3.0.4.el9 ol9_appstream 32 M
gcc-c++ x86_64 11.3.1-4.3.0.4.el9 ol9_appstream 13 M
glibc-devel x86_64 2.34-60.0.3.el9_2.7 ol9_appstream 68 k
glibc-headers x86_64 2.34-60.0.3.el9_2.7 ol9_appstream 918 k
kernel-headers x86_64 5.14.0-284.30.1.el9_2 ol9_appstream 5.7 M
php-devel-8.0.27-1.el9_1.x86_64
php-fedora-autoloader-1.0.1-7.el9.noarch
php-nikic-php-parser4-4.17.1-1.el9.noarch
php-pear-1:1.10.13-1.el9.noarch
php-process-8.0.27-1.el9_1.x86_64
php-xml-8.0.27-1.el9_1.x86_64
xz-devel-5.2.5-8.el9_0.x86_64
zlib-devel-1.2.11-39.el9.x86_64
Complete!
Step 10: Install PHP Imagick by executing pecl command.
[root@linuxhelp ~]# pecl install imagick
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading imagick-3.7.0.tgz ...
Starting to download imagick-3.7.0.tgz (360,138 bytes)
.........................................................................done: 360,138 bytes
33 source files, building
running: phpize
Configuring for:
PHP Api Version: 20200930
Zend Module Api No: 20200930
checking for egrep... /usr/bin/grep -E
checking for icc... no
checking for suncc... no
checking for pkg-config... /usr/bin/pkg-config
checking PHP version is at least 5.3.2... yes. found 8.0.27
libs
-lMagickWand-6.Q16 -lMagickCore-6.Q16
checking for MagickGetVersion... yes
func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/sh /var/tmp/pear-build-rootA42524/imagick-3.7.0/libtool --mode=compile cc -I. -I/var/tmp/imagick -I/var/tmp/pear-build-rootA42524/imagick-3.7.0/include -I/var/tmp/pear-build-rootA42524/imagick-3.7.0/main -I/var/tmp/imagick -I/usr/include/php -I/usr/include/php/main
822194 0 drwxr-xr-x. 3 root root 21 Aug 14 04:26 /var/tmp/pear-build-rootA42524/install-imagick-3.7.0/usr/lib64/php
Build process completed successfully
Installing '/usr/lib64/php/modules/imagick.so'
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
Step 11: Add the Imagick extension to php.ini file by using the below Command
[root@linuxhelp ~]# echo "extension=imagick.so" > /etc/php.d/20-imagick.ini
Step 12: Restart Apache and PHP services to load Imagick module by using the below command
[root@linuxhelp ~]# systemctl restart httpd php-fpm
Step 13: Execute the following command to verify that Imagick module is loaded successfully.
[root@Linuxhelp ~]# php -m | grep imagick
Imagick
Step 14: Verify this by creating a phpinfo webpage
[root@Linuxhelp ~]# echo "<?php phpinfo ();?>" > /var/www/html/index.php
Step 15: Open web browser and search our server IP address as shown in the below image.
http://192.168.6.140
Step 16: Scroll down and will find the Imagick section as shown in the below image.
Conclusion:
We have reached the end of this article. In this guide, we have walked you through the steps required to Install Imagick on Oracle Linux 9.3. Your feedback is much welcome.
use the convert --version command