Remi’s repositoryを使ってCentOS 8にphp 7.4をインストールしてみました。
Remi’s RPM repository
https://rpms.remirepo.net/
ちなみに標準て提供されているphpのバージョンは7.2.11です。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[root@centos8 ~]# dnf info php Available Packages Name : php Version : 7.2.11 Release : 1.module_el8.0.0+56+d1ca79aa Arch : x86_64 Size : 1.5 M Source : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.src.rpm Repo : AppStream Summary : PHP scripting language for creating dynamic web sites URL : http://www.php.net/ License : PHP and Zend and BSD and MIT and ASL 1.0 Description : PHP is an HTML-embedded scripting language. PHP attempts to make it : easy for developers to write dynamically generated web pages. PHP also : offers built-in database integration for several commercial and : non-commercial database management systems, so writing a : database-enabled webpage with PHP is fairly simple. The most common : use of PHP coding is probably as a replacement for CGI scripts. : : The php package contains the module (often referred to as mod_php) : which adds support for the PHP language to Apache HTTP Server. |
- Remi’s repositoryのインストール
- php7.4インストール
- dnf moduleでインストール
Remi’s repositoryをインストールします。
このrepositoryにはepel 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 |
[root@centos8 ~]# dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm remi-release-8.rpm 9.1 kB/s | 20 kB 00:02 Dependencies resolved. ===================================================================================== Package Arch Version Repository Size ===================================================================================== Installing: remi-release noarch 8.0-4.el8.remi @commandline 20 k Installing dependencies: epel-release noarch 8-5.el8 extras 22 k Transaction Summary ===================================================================================== Install 2 Packages Total size: 42 k Total download size: 22 k Installed size: 43 k Is this ok [y/N]: y Downloading Packages: epel-release-8-5.el8.noarch.rpm 22 kB/s | 22 kB 00:01 ------------------------------------------------------------------------------------- Total 8.5 kB/s | 22 kB 00:02 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : epel-release-8-5.el8.noarch 1/2 Installing : remi-release-8.0-4.el8.remi.noarch 2/2 Running scriptlet: remi-release-8.0-4.el8.remi.noarch 2/2 Verifying : epel-release-8-5.el8.noarch 1/2 Verifying : remi-release-8.0-4.el8.remi.noarch 2/2 Installed: remi-release-8.0-4.el8.remi.noarch epel-release-8-5.el8.noarch Complete! [root@centos8 ~]# ls -l /etc/yum.repos.d/ total 72 -rw-r--r--. 1 root root 731 Aug 14 15:42 CentOS-AppStream.repo -rw-r--r--. 1 root root 712 Aug 14 15:42 CentOS-Base.repo -rw-r--r--. 1 root root 1320 Aug 14 15:42 CentOS-CR.repo -rw-r--r--. 1 root root 668 Aug 14 15:42 CentOS-Debuginfo.repo -rw-r--r--. 1 root root 756 Aug 14 15:42 CentOS-Extras.repo -rw-r--r--. 1 root root 928 Aug 14 15:42 CentOS-Media.repo -rw-r--r--. 1 root root 736 Aug 14 15:42 CentOS-PowerTools.repo -rw-r--r--. 1 root root 1382 Aug 14 15:42 CentOS-Sources.repo -rw-r--r--. 1 root root 74 Aug 14 15:42 CentOS-Vault.repo -rw-r--r--. 1 root root 798 Aug 14 15:42 CentOS-centosplus.repo -rw-r--r--. 1 root root 338 Aug 14 15:42 CentOS-fasttrack.repo -rw-r--r--. 1 root root 271 Oct 29 10:11 MariaDB.repo -rw-r--r--. 1 root root 1351 Aug 7 03:17 epel-playground.repo -rw-r--r--. 1 root root 1305 Aug 7 03:17 epel-testing.repo -rw-r--r--. 1 root root 1206 Aug 7 03:17 epel.repo -rw-r--r--. 1 root root 903 Sep 27 21:47 remi-modular.repo -rw-r--r--. 1 root root 778 Sep 27 21:47 remi-safe.repo -rw-r--r--. 1 root root 1384 Sep 27 21:47 remi.repo |
Remi’s repositoryでインストールできるphpのバージョンです。
7.0から7.4までインストールできそうです。
1 2 3 4 5 6 |
[root@centos8 ~]# dnf list php7* | grep -E php7.\.x86_64 php70.x86_64 2.0-1.el8.remi remi-safe php71.x86_64 2.0-1.el8.remi remi-safe php72.x86_64 2.0-1.el8.remi remi-safe php73.x86_64 2.0-1.el8.remi remi-safe php74.x86_64 1.0-1.el8.remi remi-safe |
そのままインストールしてみます。
ソフトウェアコレクションで他のバージョンと同居できるようにインストールされました。
こっちはremi-safe repoでのインストールか。
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 |
[root@centos8 ~]# dnf -y install php74 Last metadata expiration check: 0:00:30 ago on Wed Oct 30 20:15:50 2019. Dependencies resolved. ===================================================================================== Package Arch Version Repository Size ===================================================================================== Installing: php74 x86_64 1.0-1.el8.remi remi-safe 6.6 k Installing dependencies: scl-utils x86_64 1:2.0.2-7.el8 AppStream 46 k environment-modules x86_64 4.1.4-1.el8 BaseOS 254 k tcl x86_64 1:8.6.8-2.el8 BaseOS 1.1 M php74-php-cli x86_64 7.4.0~rc5-33.el8.remi remi-safe 3.1 M php74-php-common x86_64 7.4.0~rc5-33.el8.remi remi-safe 681 k php74-php-json x86_64 7.4.0~rc5-33.el8.remi remi-safe 76 k php74-runtime x86_64 1.0-1.el8.remi remi-safe 1.1 M Transaction Summary ===================================================================================== Install 8 Packages Total download size: 6.4 M Installed size: 25 M Downloading Packages: (1/8): scl-utils-2.0.2-7.el8.x86_64.rpm 1.1 MB/s | 46 kB 00:00 (2/8): tcl-8.6.8-2.el8.x86_64.rpm 8.0 MB/s | 1.1 MB 00:00 (3/8): environment-modules-4.1.4-1.el8.x86_64.rpm 1.7 MB/s | 254 kB 00:00 (4/8): php74-1.0-1.el8.remi.x86_64.rpm 11 kB/s | 6.6 kB 00:00 (5/8): php74-php-json-7.4.0~rc5-33.el8.remi.x86_64.r 77 kB/s | 76 kB 00:00 (6/8): php74-php-cli-7.4.0~rc5-33.el8.remi.x86_64.rp 1.2 MB/s | 3.1 MB 00:02 (7/8): php74-php-common-7.4.0~rc5-33.el8.remi.x86_64 226 kB/s | 681 kB 00:03 (8/8): php74-runtime-1.0-1.el8.remi.x86_64.rpm 505 kB/s | 1.1 MB 00:02 ------------------------------------------------------------------------------------- Total 855 kB/s | 6.4 MB 00:07 warning: /var/cache/dnf/remi-safe-ff04689114f71b24/packages/php74-1.0-1.el8.remi.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 5f11735a: NOKEY Safe Remi's RPM repository for Enterprise Linux 8 - 3.0 MB/s | 3.1 kB 00:00 Importing GPG key 0x5F11735A: Userid : "Remi's RPM repository <remi@remirepo.net>" Fingerprint: 6B38 FEA7 231F 87F5 2B9C A9D8 5550 9759 5F11 735A From : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el8 Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : tcl-1:8.6.8-2.el8.x86_64 1/8 Running scriptlet: tcl-1:8.6.8-2.el8.x86_64 1/8 Installing : environment-modules-4.1.4-1.el8.x86_64 2/8 Running scriptlet: environment-modules-4.1.4-1.el8.x86_64 2/8 Installing : scl-utils-1:2.0.2-7.el8.x86_64 3/8 Installing : php74-runtime-1.0-1.el8.remi.x86_64 4/8 Running scriptlet: php74-runtime-1.0-1.el8.remi.x86_64 4/8 Installing : php74-php-json-7.4.0~rc5-33.el8.remi.x86_64 5/8 Installing : php74-php-common-7.4.0~rc5-33.el8.remi.x86_64 6/8 Installing : php74-php-cli-7.4.0~rc5-33.el8.remi.x86_64 7/8 Installing : php74-1.0-1.el8.remi.x86_64 8/8 Running scriptlet: php74-1.0-1.el8.remi.x86_64 8/8 Verifying : scl-utils-1:2.0.2-7.el8.x86_64 1/8 Verifying : environment-modules-4.1.4-1.el8.x86_64 2/8 Verifying : tcl-1:8.6.8-2.el8.x86_64 3/8 Verifying : php74-1.0-1.el8.remi.x86_64 4/8 Verifying : php74-php-cli-7.4.0~rc5-33.el8.remi.x86_64 5/8 Verifying : php74-php-common-7.4.0~rc5-33.el8.remi.x86_64 6/8 Verifying : php74-php-json-7.4.0~rc5-33.el8.remi.x86_64 7/8 Verifying : php74-runtime-1.0-1.el8.remi.x86_64 8/8 Installed: php74-1.0-1.el8.remi.x86_64 scl-utils-1:2.0.2-7.el8.x86_64 environment-modules-4.1.4-1.el8.x86_64 tcl-1:8.6.8-2.el8.x86_64 php74-php-cli-7.4.0~rc5-33.el8.remi.x86_64 php74-php-common-7.4.0~rc5-33.el8.remi.x86_64 php74-php-json-7.4.0~rc5-33.el8.remi.x86_64 php74-runtime-1.0-1.el8.remi.x86_64 Complete! [root@centos8 ~]# php -v -bash: php: command not found [root@centos8 ~]# php74 -v PHP 7.4.0RC5 (cli) (built: Oct 29 2019 08:49:19) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0-dev, Copyright (c) Zend Technologies |
RHEL 8/CentOS 8からmoduleオプションが追加されたようで、これでインストールするとシステム標準として配置されるようです。
こっちはremi-modular repoか。
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 |
[root@centos8 ~]# dnf module install php:remi-7.4 Last metadata expiration check: 0:05:46 ago on Wed Oct 30 20:15:50 2019. Dependencies resolved. ===================================================================================== Package Arch Version Repository Size ===================================================================================== Installing group/module packages: php-cli x86_64 7.4.0~RC5-14.el8.remi remi-modular 4.6 M php-common x86_64 7.4.0~RC5-14.el8.remi remi-modular 1.2 M php-fpm x86_64 7.4.0~RC5-14.el8.remi remi-modular 1.6 M php-json x86_64 7.4.0~RC5-14.el8.remi remi-modular 73 k php-mbstring x86_64 7.4.0~RC5-14.el8.remi remi-modular 523 k php-xml x86_64 7.4.0~RC5-14.el8.remi remi-modular 212 k Installing dependencies: httpd-filesystem noarch 2.4.37-12.module_el8.0.0+185+5908b0db AppStream 35 k oniguruma x86_64 6.8.2-1.el8 AppStream 188 k Installing weak dependencies: nginx-filesystem noarch 1:1.14.1-9.module_el8.0.0+184+e34fea82 AppStream 24 k Installing module profiles: php/common Enabling module streams: httpd 2.4 nginx 1.14 php remi-7.4 Transaction Summary ===================================================================================== Install 9 Packages Total download size: 8.4 M Installed size: 42 M Is this ok [y/N]: y Downloading Packages: (1/9): nginx-filesystem-1.14.1-9.module_el8.0.0+184+ 504 kB/s | 24 kB 00:00 (2/9): httpd-filesystem-2.4.37-12.module_el8.0.0+185 675 kB/s | 35 kB 00:00 (3/9): oniguruma-6.8.2-1.el8.x86_64.rpm 735 kB/s | 188 kB 00:00 (4/9): php-common-7.4.0~RC5-14.el8.remi.x86_64.rpm 547 kB/s | 1.2 MB 00:02 (5/9): php-fpm-7.4.0~RC5-14.el8.remi.x86_64.rpm 634 kB/s | 1.6 MB 00:02 (6/9): php-cli-7.4.0~RC5-14.el8.remi.x86_64.rpm 1.5 MB/s | 4.6 MB 00:03 (7/9): php-json-7.4.0~RC5-14.el8.remi.x86_64.rpm 69 kB/s | 73 kB 00:01 (8/9): php-xml-7.4.0~RC5-14.el8.remi.x86_64.rpm 146 kB/s | 212 kB 00:01 (9/9): php-mbstring-7.4.0~RC5-14.el8.remi.x86_64.rpm 306 kB/s | 523 kB 00:01 ------------------------------------------------------------------------------------- Total 1.1 MB/s | 8.4 MB 00:07 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : php-json-7.4.0~RC5-14.el8.remi.x86_64 1/9 Running scriptlet: php-common-7.4.0~RC5-14.el8.remi.x86_64 2/9 Installing : php-common-7.4.0~RC5-14.el8.remi.x86_64 2/9 Installing : oniguruma-6.8.2-1.el8.x86_64 3/9 Running scriptlet: oniguruma-6.8.2-1.el8.x86_64 3/9 Running scriptlet: nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.n 4/9 Installing : nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.n 4/9 Running scriptlet: httpd-filesystem-2.4.37-12.module_el8.0.0+185+5908b0db.no 5/9 Installing : httpd-filesystem-2.4.37-12.module_el8.0.0+185+5908b0db.no 5/9 Installing : php-fpm-7.4.0~RC5-14.el8.remi.x86_64 6/9 Running scriptlet: php-fpm-7.4.0~RC5-14.el8.remi.x86_64 6/9 Installing : php-mbstring-7.4.0~RC5-14.el8.remi.x86_64 7/9 Installing : php-cli-7.4.0~RC5-14.el8.remi.x86_64 8/9 Installing : php-xml-7.4.0~RC5-14.el8.remi.x86_64 9/9 Running scriptlet: php-xml-7.4.0~RC5-14.el8.remi.x86_64 9/9 Running scriptlet: php-fpm-7.4.0~RC5-14.el8.remi.x86_64 9/9 Verifying : httpd-filesystem-2.4.37-12.module_el8.0.0+185+5908b0db.no 1/9 Verifying : nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.n 2/9 Verifying : oniguruma-6.8.2-1.el8.x86_64 3/9 Verifying : php-cli-7.4.0~RC5-14.el8.remi.x86_64 4/9 Verifying : php-common-7.4.0~RC5-14.el8.remi.x86_64 5/9 Verifying : php-fpm-7.4.0~RC5-14.el8.remi.x86_64 6/9 Verifying : php-json-7.4.0~RC5-14.el8.remi.x86_64 7/9 Verifying : php-mbstring-7.4.0~RC5-14.el8.remi.x86_64 8/9 Verifying : php-xml-7.4.0~RC5-14.el8.remi.x86_64 9/9 Installed: php-cli-7.4.0~RC5-14.el8.remi.x86_64 php-common-7.4.0~RC5-14.el8.remi.x86_64 php-fpm-7.4.0~RC5-14.el8.remi.x86_64 php-json-7.4.0~RC5-14.el8.remi.x86_64 php-mbstring-7.4.0~RC5-14.el8.remi.x86_64 php-xml-7.4.0~RC5-14.el8.remi.x86_64 nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch httpd-filesystem-2.4.37-12.module_el8.0.0+185+5908b0db.noarch oniguruma-6.8.2-1.el8.x86_64 Complete! [root@centos8 ~]# php -v PHP 7.4.0RC5 (cli) (built: Oct 29 2019 08:49:19) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0-dev, Copyright (c) Zend Technologies |
dnf moduleでインストールすればphp7.1とかもシステム標準でインストールできるってことですね。
いろいろ検証しないと。