0

It appears ImageMagick and ImageMagick-devel are removed from RHEL 8.

I have added 3rd party repositories such as EPEL, REMI, & RPMFusion.

I am able to install the GraphicsMagick replacement for Imagemagick but it appears Gmagick is not compatible with ImageMagick at PHP library code level.

So the below method does not help... for the plugin I am using which depends on PHP Imagemagick, while using Gmagick to convert something in the CLI it will work.

$ dnf install GraphicsMagick GraphicsMagick-devel GraphicsMagick-perl ghostscript
$ cd /usr/local/src
$ wget https://pecl.php.net/get/gmagick
$ tar xfvz gmagick $ cd gmagick-*
$ phpize 
$ ./configure
$ make
$ make installl
$ php --ini | grep 'Loaded Configuration File'
$ nano /etc/php.ini
// add extension to end of php.ini
extension=gmagick.so

When trying to install ImageMagick

$ sudo yum install ImageMagick-devel

No match for argument: ImageMagick-deval
Error: Unable to find a match: ImageMagick-deval

$ pecl install imagick

checking whether to enable the imagick extension... yes, shared
checking for pkg-config... /bin/pkg-config
checking ImageMagick MagickWand API configuration program... checking
Testing /usr/local/bin/MagickWand-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... Doesn't exist
checking Testing /usr/sbin/bin/MagickWand-config... Doesn't exist
checking Testing /opt/bin/MagickWand-config... Doesn't exist
checking Testing /opt/local/bin/MagickWand-config... Doesn't exist
configure: error: not found. Please provide a path to MagickWand-config
or Wand-config program.
ERROR: `/var/tmp/imagick/configure --with-php-config=/bin/php-config
--with-imagick' failed

Is there a way to manually get ImageMagick, ImageMagick-devel and PECL Imagick installed on RHEL 8 (NOT Gmagick)

EDIT

# dnf repolist
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:00:17 ago on Fri 28 Feb 2020 20:58:19 UTC.
repo id                                                                        repo name                                                                                                              status
*epel                                                                          Extra Packages for Enterprise Linux 8 - x86_64                                                                         4,916
*epel-modular                                                                  Extra Packages for Enterprise Linux Modular 8 - x86_64                                                                     0
remi-modular                                                                   Remi's Modular repository for Enterprise Linux 8 - x86_64                                                                 16
remi-safe                                                                      Safe Remi's RPM repository for Enterprise Linux 8 - x86_64                                                             2,133
rhel-8-appstream-rhui-rpms                                                     Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)                                                     8,566
rhel-8-baseos-rhui-rpms                                                        Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs)                                                        3,690
rhui-client-config-server-8                                                    Red Hat Update Infrastructure 3 Client Configuration Server 8                                                              6
rpmfusion-free-updates                                                         RPM Fusion for EL 8 - Free - Updates
# yum install ImageMagick-devel
Error:
 Problem: conflicting requests
  - nothing provides jasper-devel needed by ImageMagick-devel-6.9.10.86-1.el8.x86_64
  - nothing provides OpenEXR-devel needed by ImageMagick-devel-6.9.10.86-1.el8.x86_64
  - nothing provides ghostscript-devel needed by ImageMagick-devel-6.9.10.86-1.el8.x86_64
  - nothing provides lcms2-devel needed by ImageMagick-devel-6.9.10.86-1.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

SOLVED - https://www.imagemagick.org/script/install-source.php#unix

$ cd ImageMagick-7.0.9-26
$ ./configure
$ make
$ make install
$ sudo ldconfig /usr/local/lib
$ pecl install imagick
$ nano /etc/php.ini
// Add the following
extension=imagick.so

Works after removing Gmagick

Clean try with

$ sudo dnf install ImageMagick
$ dnf install php73-php-pecl-imagick
# php --ini | grep 'Loaded Configuration File'
PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/lib64/php/modules/imagick.so (/usr/lib64/php/modules/imagick.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/imagick.so.so (/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Loaded Configuration File:         /etc/php.ini

# ls
bz2.so       curl.so  fileinfo.so  gettext.so  json.so      mysqli.so   pdo_mysql.so   phar.so   simplexml.so  sysvmsg.so  tokenizer.so  xml.so
calendar.so  dom.so   ftp.so       iconv.so    mbstring.so  mysqlnd.so  pdo.so         posix.so  sockets.so    sysvsem.so  wddx.so       xmlwriter.so
ctype.so     exif.so  gd.so        intl.so     mcrypt.so    opcache.so  pdo_sqlite.so  shmop.so  sqlite3.so    sysvshm.so  xmlreader.so  xsl.so

nothing shown in php -m for imagick

# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/lib64/php/modules/imagick.so (/usr/lib64/php/modules/imagick.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/imagick.so.so (/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.3.5 (cli) (built: Apr 30 2019 08:37:17) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.5, Copyright (c) 1999-2018, by Zend Technologies

Tony Clemmey
  • 21
  • 1
  • 1
  • 6
  • `ImageMagick-devel` is present in EPEL. Why are you stating that it's not? – Danila Vershinin Feb 28 '20 at 20:44
  • @DanilaVershinin EPEL for Linux 8 ? Please see added edit code to show EPEL is installed..Please check EPEL on RHEL 8 and see. – Tony Clemmey Feb 28 '20 at 21:01
  • A manual install might lead to problems later. If I were you, I'd get the RHEL7 RPMs or if you know more RPM stuff, rebuild the RPMs with the latest source. – Aaron D. Marasco Feb 29 '20 at 15:36
  • @AaronD.Marasco Would you have any experience doing this? – Tony Clemmey Feb 29 '20 at 15:57
  • @TonyClemmey yes I do, but depending on the source code it can get quite complex and hairy. I'm glad you were able to find the proper name for the RPMs in the repo you were using. – Aaron D. Marasco Mar 01 '20 at 15:31
  • Hey @AaronD.Marasco after using a clean RHEL 8 VM to try this on `dnf install ImageMagick` & `dnf install php73-php-pecl-imagick` didnt actually seem to work. Updated my question. – Tony Clemmey Mar 02 '20 at 22:55

2 Answers2

2

It looks like you seek to install PHP imagick module while having Remi repos around. So why not install directly the packaged module in lieu of compiling it?

Instead of pecl install imagick you can do something like dnf install php74-php-pecl-imagick. The actual command depends on whether you want multiple PHP versions or replace the default one, use config wizard for a hint.

Then you will not need any -devel packages installed.

If for some reason you don't want to rely on a packaged install the PHP module and really want to compile, you need to enable CodeReady Builder repo:

sudo subscription-manager repos --enable "codeready-builder-for-rhel-8-*-rpms"
Danila Vershinin
  • 8,725
  • 2
  • 29
  • 35
  • Thanks @Danila I have just successfully installed from here - https://www.imagemagick.org/script/install-source.php#unix removing GraphicsMagick. Convert does not seem to show in CLI `$ convert --version`, but the PHP module and front end ImageMagick tool is working....So that's the fix I needed, Gmagick worked in CLI but not for the tool needing PHP Imagick. GUI is only what is needed for this anyway. – Tony Clemmey Feb 28 '20 at 22:32
  • 1
    I also checked and as you said `dnf install php73-php-pecl-imagick` worked with EPEL & REMI repos. Thanks – Tony Clemmey Mar 01 '20 at 09:42
  • Hey @Danila after using a clean RHEL 8 VM to try this on `dnf install ImageMagick` & `dnf install php73-php-pecl-imagick` didn't actually seem to work. Updated my question with outputs. – Tony Clemmey Mar 02 '20 at 22:56
  • What was the output immediately after you ran `dnf install php73-php-pecl-imagick`? If it's an absolutely clean OS, have you forgot to add Remi repos? – Danila Vershinin Mar 02 '20 at 23:04
  • Repos EPEL, REMI and RPMFusion ...all installed/enabled....No the output does/did not show immediately after `dnf install php73-php-pecl-imagick` it installed, then added `extension=imagick.so` to php.ini but after restart php/httpd no module showed in phpinfo and then the output shows `php -v` `php -i` – Tony Clemmey Mar 02 '20 at 23:20
  • # convert --version Version: ImageMagick 6.9.10-86 Q16 x86_64 2020-01-13 https://imagemagick.org – Tony Clemmey Mar 02 '20 at 23:21
  • Just to be clear, I will refer once again to the [wizard](https://rpms.remirepo.net/wizard/) with further explanation. When you install like the following: `dnf install php73-php-pecl-imagick`, you are installing a software collection, which means to use it on the command line, it must be activated in your bash session, e.g. `. /opt/remi/php73/enable`. If you mean to replace the system version, you need to (simply following the wizard, I copy-paste here): `dnf module reset php` and `dnf module install php:remi-7.3`. And install the module with `dnf install php-pecl-imagick` – Danila Vershinin Mar 03 '20 at 00:01
  • Got you. Thanks for the guidance on this and the wizard page. All sorted. Thanks again! – Tony Clemmey Mar 03 '20 at 10:13
0

CENTOS 8

dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
dnf install GraphicsMagick