RHEL8/CentOS8ではImageMagickパッケージが削除されました。
代わりにImageMagickから分岐したGraphicsMagickがあるようですが、今回はImageMagickをソースから導入してみました。
参考サイトです。
Install ImageMagick (Image Manipulation) Tool on RHEL/CentOS and Fedora
https://www.tecmint.com/install-imagemagick-in-linux/
事前に開発ツールをインストールして下さい。
1 |
[root@centos8 ~]# dnf groupinstall 'Development Tools' |
- ソースのダウンロード
- 解凍
- コンパイル
- 確認
- PHP拡張
1 2 3 4 5 6 7 8 9 10 11 |
[root@centos8 ~]# wget https://www.imagemagick.org/download/ImageMagick.tar.gz --2019-11-08 17:22:07-- https://www.imagemagick.org/download/ImageMagick.tar.gz Resolving www.imagemagick.org (www.imagemagick.org)... 198.72.81.86 Connecting to www.imagemagick.org (www.imagemagick.org)|198.72.81.86|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 13753112 (13M) [application/x-gzip] Saving to: 'ImageMagick.tar.gz' ImageMagick.tar.gz 100%[==========================>] 13.12M 6.60MB/s in 2.0s 2019-11-08 17:22:10 (6.60 MB/s) - 'ImageMagick.tar.gz' saved [13753112/13753112] |
1 2 3 4 5 6 |
[root@centos8 ~]# tar xvfz ImageMagick.tar.gz ImageMagick-7.0.9-2/ ImageMagick-7.0.9-2/Install-unix.txt ImageMagick-7.0.9-2/ChangeLog ImageMagick-7.0.9-2/winpath.sh (snip) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[root@centos8 ~]# cd ImageMagick-7.0.9-2/ [root@centos8 ImageMagick-7.0.9-2]# ./configure checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu (snip) [root@centos8 ImageMagick-7.0.9-2]# make make all-am make[1]: Entering directory '/root/ImageMagick-7.0.9-2' CC utilities/magick.o (snip) [root@centos8 ImageMagick-7.0.9-2]# make install make install-am make[1]: Entering directory '/root/ImageMagick-7.0.9-2' make[2]: Entering directory '/root/ImageMagick-7.0.9-2' /usr/bin/mkdir -p '/usr/local/lib' (snip) |
1 2 3 4 5 6 |
[root@centos8 ImageMagick-7.0.9-2]# magick -version Version: ImageMagick 7.0.9-2 Q16 x86_64 2019-11-08 https://imagemagick.org Copyright: © 1999-2019 ImageMagick Studio LLC License: https://imagemagick.org/script/license.php Features: Cipher DPC HDRI OpenMP(4.5) Delegates (built-in): |
phpから利用するためのモジュールをインストールします。
phpはremi repoで導入した7.4です。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
[root@centos8 ~]# dnf -y install php-pear Dependencies resolved. ========================================================================================== Package Arch Version Repository Size ========================================================================================== Installing: php-pear noarch 1:1.10.9-4.el8.remi remi-modular 362 k Installing dependencies: php-fedora-autoloader noarch 1.0.0-5.el8.remi remi-modular 13 k php-process x86_64 7.4.0~RC5-14.el8.remi remi-modular 95 k Transaction Summary ========================================================================================== Install 3 Packages Total download size: 470 k Installed size: 2.3 M Downloading Packages: (1/3): php-fedora-autoloader-1.0.0-5.el8.remi.noarch.rpm 7.5 kB/s | 13 kB 00:01 (2/3): php-process-7.4.0~RC5-14.el8.remi.x86_64.rpm 42 kB/s | 95 kB 00:02 (3/3): php-pear-1.10.9-4.el8.remi.noarch.rpm 143 kB/s | 362 kB 00:02 ------------------------------------------------------------------------------------------ Total 116 kB/s | 470 kB 00:04 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : php-process-7.4.0~RC5-14.el8.remi.x86_64 1/3 Installing : php-fedora-autoloader-1.0.0-5.el8.remi.noarch 2/3 Installing : php-pear-1:1.10.9-4.el8.remi.noarch 3/3 Running scriptlet: php-pear-1:1.10.9-4.el8.remi.noarch 3/3 Verifying : php-fedora-autoloader-1.0.0-5.el8.remi.noarch 1/3 Verifying : php-pear-1:1.10.9-4.el8.remi.noarch 2/3 Verifying : php-process-7.4.0~RC5-14.el8.remi.x86_64 3/3 Installed: php-pear-1:1.10.9-4.el8.remi.noarch php-fedora-autoloader-1.0.0-5.el8.remi.noarch php-process-7.4.0~RC5-14.el8.remi.x86_64 Complete! |
php-develのインストールでエラーになりました。
1 2 3 4 5 6 |
[root@centos8 ~]# dnf install php-devel Last metadata expiration check: 1:09:18 ago on Fri Nov 8 16:52:28 2019. Error: Problem: cannot install the best candidate for the job - nothing provides libedit-devel(x86-64) needed by php-devel-7.4.0~RC5-14.el8.remi.x86_64 (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages) |
調べたらこれかな? PowerTools repositoryはCentOS開発者向けリポジトリのようです。
From Centos-8 repos, libedit-devel packages missing
https://bugs.centos.org/view.php?id=16604
Repository installation
https://blog.remirepo.net/post/2019/09/24/CentOS-8-repository
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
[root@centos8 ~]# dnf config-manager --set-enabled PowerTools [root@centos8 ~]# dnf install php-devel CentOS-8 - PowerTools 725 kB/s | 1.8 MB 00:02 Dependencies resolved. ========================================================================================== Package Arch Version Repository Size ========================================================================================== Installing: php-devel x86_64 7.4.0~RC5-14.el8.remi remi-modular 1.1 M Installing dependencies: cmake-filesystem x86_64 3.11.4-3.el8 AppStream 40 k libxml2-devel x86_64 2.9.7-5.el8 AppStream 1.0 M keyutils-libs-devel x86_64 1.5.10-6.el8 BaseOS 48 k krb5-devel x86_64 1.16.1-22.el8 BaseOS 546 k libcom_err-devel x86_64 1.44.3-2.el8 BaseOS 37 k libkadm5 x86_64 1.16.1-22.el8 BaseOS 184 k libselinux-devel x86_64 2.8-6.el8 BaseOS 199 k libsepol-devel x86_64 2.8-2.el8 BaseOS 85 k libverto-devel x86_64 0.3.0-5.el8 BaseOS 18 k ncurses-c++-libs x86_64 6.1-7.20180224.el8 BaseOS 58 k ncurses-devel x86_64 6.1-7.20180224.el8 BaseOS 527 k openssl-devel x86_64 1:1.1.1-8.el8 BaseOS 2.3 M pcre2-devel x86_64 10.32-1.el8 BaseOS 605 k pcre2-utf16 x86_64 10.32-1.el8 BaseOS 228 k pcre2-utf32 x86_64 10.32-1.el8 BaseOS 220 k xz-devel x86_64 5.2.4-3.el8 BaseOS 62 k zlib-devel x86_64 1.2.11-10.el8 BaseOS 56 k libedit-devel x86_64 3.1-23.20170329cvs.el8 PowerTools 44 k Transaction Summary ========================================================================================== Install 19 Packages Total download size: 7.3 M Installed size: 28 M Is this ok [y/N]: y Downloading Packages: (1/19): cmake-filesystem-3.11.4-3.el8.x86_64.rpm 38 kB/s | 40 kB 00:01 A (2/19): keyutils-libs-devel-1.5.10-6.el8.x86_64.rpm 45 kB/s | 48 kB 00:01 (3/19): libcom_err-devel-1.44.3-2.el8.x86_64.rpm 2.0 MB/s | 37 kB 00:00 (4/19): libxml2-devel-2.9.7-5.el8.x86_64.rpm 929 kB/s | 1.0 MB 00:01 (5/19): libkadm5-1.16.1-22.el8.x86_64.rpm 3.2 MB/s | 184 kB 00:00 (6/19): libsepol-devel-2.8-2.el8.x86_64.rpm 4.3 MB/s | 85 kB 00:00 (7/19): libverto-devel-0.3.0-5.el8.x86_64.rpm 849 kB/s | 18 kB 00:00 (8/19): ncurses-c++-libs-6.1-7.20180224.el8.x86_64.rpm 3.3 MB/s | 58 kB 00:00 (9/19): krb5-devel-1.16.1-22.el8.x86_64.rpm 3.5 MB/s | 546 kB 00:00 (10/19): ncurses-devel-6.1-7.20180224.el8.x86_64.rpm 7.0 MB/s | 527 kB 00:00 (11/19): libselinux-devel-2.8-6.el8.x86_64.rpm 1.4 MB/s | 199 kB 00:00 (12/19): pcre2-devel-10.32-1.el8.x86_64.rpm 7.9 MB/s | 605 kB 00:00 (13/19): pcre2-utf32-10.32-1.el8.x86_64.rpm 7.4 MB/s | 220 kB 00:00 (14/19): xz-devel-5.2.4-3.el8.x86_64.rpm 1.6 MB/s | 62 kB 00:00 (15/19): openssl-devel-1.1.1-8.el8.x86_64.rpm 9.9 MB/s | 2.3 MB 00:00 (16/19): zlib-devel-1.2.11-10.el8.x86_64.rpm 2.1 MB/s | 56 kB 00:00 (17/19): libedit-devel-3.1-23.20170329cvs.el8.x86_64.rpm 1.1 MB/s | 44 kB 00:00 (18/19): pcre2-utf16-10.32-1.el8.x86_64.rpm 616 kB/s | 228 kB 00:00 (19/19): php-devel-7.4.0~RC5-14.el8.remi.x86_64.rpm 522 kB/s | 1.1 MB 00:02 ------------------------------------------------------------------------------------------ Total 1.2 MB/s | 7.3 MB 00:06 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : zlib-devel-1.2.11-10.el8.x86_64 1/19 Installing : xz-devel-5.2.4-3.el8.x86_64 2/19 Installing : pcre2-utf32-10.32-1.el8.x86_64 3/19 Installing : pcre2-utf16-10.32-1.el8.x86_64 4/19 Installing : pcre2-devel-10.32-1.el8.x86_64 5/19 Installing : ncurses-c++-libs-6.1-7.20180224.el8.x86_64 6/19 Installing : ncurses-devel-6.1-7.20180224.el8.x86_64 7/19 Installing : libedit-devel-3.1-23.20170329cvs.el8.x86_64 8/19 Installing : libverto-devel-0.3.0-5.el8.x86_64 9/19 Installing : libsepol-devel-2.8-2.el8.x86_64 10/19 Installing : libselinux-devel-2.8-6.el8.x86_64 11/19 Installing : libkadm5-1.16.1-22.el8.x86_64 12/19 Installing : libcom_err-devel-1.44.3-2.el8.x86_64 13/19 Installing : keyutils-libs-devel-1.5.10-6.el8.x86_64 14/19 Installing : krb5-devel-1.16.1-22.el8.x86_64 15/19 Installing : openssl-devel-1:1.1.1-8.el8.x86_64 16/19 Installing : cmake-filesystem-3.11.4-3.el8.x86_64 17/19 Installing : libxml2-devel-2.9.7-5.el8.x86_64 18/19 Installing : php-devel-7.4.0~RC5-14.el8.remi.x86_64 19/19 Running scriptlet: php-devel-7.4.0~RC5-14.el8.remi.x86_64 19/19 Verifying : cmake-filesystem-3.11.4-3.el8.x86_64 1/19 Verifying : libxml2-devel-2.9.7-5.el8.x86_64 2/19 Verifying : keyutils-libs-devel-1.5.10-6.el8.x86_64 3/19 Verifying : krb5-devel-1.16.1-22.el8.x86_64 4/19 Verifying : libcom_err-devel-1.44.3-2.el8.x86_64 5/19 Verifying : libkadm5-1.16.1-22.el8.x86_64 6/19 Verifying : libselinux-devel-2.8-6.el8.x86_64 7/19 Verifying : libsepol-devel-2.8-2.el8.x86_64 8/19 Verifying : libverto-devel-0.3.0-5.el8.x86_64 9/19 Verifying : ncurses-c++-libs-6.1-7.20180224.el8.x86_64 10/19 Verifying : ncurses-devel-6.1-7.20180224.el8.x86_64 11/19 Verifying : openssl-devel-1:1.1.1-8.el8.x86_64 12/19 Verifying : pcre2-devel-10.32-1.el8.x86_64 13/19 Verifying : pcre2-utf16-10.32-1.el8.x86_64 14/19 Verifying : pcre2-utf32-10.32-1.el8.x86_64 15/19 Verifying : xz-devel-5.2.4-3.el8.x86_64 16/19 Verifying : zlib-devel-1.2.11-10.el8.x86_64 17/19 Verifying : libedit-devel-3.1-23.20170329cvs.el8.x86_64 18/19 Verifying : php-devel-7.4.0~RC5-14.el8.remi.x86_64 19/19 Installed: php-devel-7.4.0~RC5-14.el8.remi.x86_64 cmake-filesystem-3.11.4-3.el8.x86_64 libxml2-devel-2.9.7-5.el8.x86_64 keyutils-libs-devel-1.5.10-6.el8.x86_64 krb5-devel-1.16.1-22.el8.x86_64 libcom_err-devel-1.44.3-2.el8.x86_64 libkadm5-1.16.1-22.el8.x86_64 libselinux-devel-2.8-6.el8.x86_64 libsepol-devel-2.8-2.el8.x86_64 libverto-devel-0.3.0-5.el8.x86_64 ncurses-c++-libs-6.1-7.20180224.el8.x86_64 ncurses-devel-6.1-7.20180224.el8.x86_64 openssl-devel-1:1.1.1-8.el8.x86_64 pcre2-devel-10.32-1.el8.x86_64 pcre2-utf16-10.32-1.el8.x86_64 pcre2-utf32-10.32-1.el8.x86_64 xz-devel-5.2.4-3.el8.x86_64 zlib-devel-1.2.11-10.el8.x86_64 libedit-devel-3.1-23.20170329cvs.el8.x86_64 Complete! |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[root@centos8 ~]# pecl install imagick WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update downloading imagick-3.4.4.tgz ... Starting to download imagick-3.4.4.tgz (253,434 bytes) .....................................................done: 253,434 bytes 19 source files, building running: phpize Configuring for: PHP Api Version: 20190902 Zend Module Api No: 20190902 Zend Extension Api No: 320190902 Please provide the prefix of ImageMagick installation [autodetect] : building in /var/tmp/pear-build-root3D1zNr/imagick-3.4.4 (snip) Build process completed successfully Installing '/usr/lib64/php/modules/imagick.so' Installing '/usr/include/php/ext/imagick/php_imagick_shared.h' install ok: channel://pecl.php.net/imagick-3.4.4 configuration option "php_ini" is not set to php.ini location You should add "extension=imagick.so" to php.ini |
1 2 3 4 5 6 7 8 9 10 11 |
[root@centos8 ~]# echo extension=imagick.so >> /etc/php.d/30-imagick.ini [root@centos8 ~]# systemctl restart httpd [root@centos8 ~]# php -i | grep imagick /etc/php.d/30-imagick.ini, imagick imagick module => enabled imagick module version => 3.4.4 imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel imagick.locale_fix => 0 => 0 imagick.progress_monitor => 0 => 0 imagick.skip_version_check => 0 => 0 |
Pingback: ServersMan から conoHa に vps を乗り換え備忘録