看来 ImageMagick 和 ImageMagick-devel 已从 RHEL 8 中删除。
我添加了 EPEL、REMI 和 RPMFusion 等 3rd 方存储库。
我能够为 Imagemagick 安装 GraphicsMagick 替代品,但似乎 Gmagick 在 PHP 库代码级别与 ImageMagick 不兼容。
所以下面的方法没有帮助......对于我使用的插件,它依赖于 PHP Imagemagick,而使用 Gmagick 在 CLI 中转换某些东西它会起作用。
$ 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
尝试安装 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
有没有办法在 RHEL 8(不是 Gmagick)上手动安装 ImageMagick、ImageMagick-devel 和 PECL Imagick
编辑
# 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)
已解决 - 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
删除 Gmagick 后工作
清洁尝试
$ 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
php -m
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