CentOS7.9にPHP8.0をインストールする方法

本記事の位置を確認します。

①CentOSにApacheをインストール
②CentOSにPHPをインストール  👈本記事はここ
③CentOSにMariaDBをインストール
④CentOSにWordpressをインストール

それではCentOS7にPHPをインストールする方法となります。

環境

CentOS Linux release 7.9.2009 (Core)

👆👆cat /etc/redhat-release👆👆左記のコマンドでVersionを確認できます。

すでにインストールしたApacheのVersionの確認もしておきます。

CentOS7.9にApacheをインストールする方法

本記事の位置を確認します。 ①CentOSにApacheをインストール  👈本記事はここ②CentOSにPHPをインストール③CentOSにMariaDBをインストール④CentOSにWordpressをインストー…

httpd -v  👈ApacheのVersion確認を行うコマンド

実行すると下記のようになります。

[root@ホスト名 ~]# httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built: Mar 24 2022 14:57:57
[root@ホスト名 ~]#

VersionはApache2.4.6となります。

PHPインストールremiレポジトリをインストールします。

コマンドは下記になります。

yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

実行したらこうなります。

[root@ホスト名 ~]# yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Loaded plugins: fastestmirror
remi-release-7.rpm | 23 kB 00:00:00
Examining /var/tmp/yum-root-TLteC4/remi-release-7.rpm: remi-release-7.9-3.el7.remi.noarch
Marking /var/tmp/yum-root-TLteC4/remi-release-7.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package remi-release.noarch 0:7.9-3.el7.remi will be installed
--> Processing Dependency: epel-release = 7 for package: remi-release-7.9-3.el7.remi.noarch
Loading mirror speeds from cached hostfile
base: ftp.jaist.ac.jp
extras: ftp.jaist.ac.jp
updates: ftp.jaist.ac.jp
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================
Package Arch Version Repository Size
Installing:
remi-release noarch 7.9-3.el7.remi /remi-release-7 35 k
Installing for dependencies:
epel-release noarch 7-11 extras 15 k
Transaction Summary
Install 1 Package (+1 Dependent package)
Total size: 50 k
Total download size: 15 k
Installed size: 59 k
Downloading packages:
epel-release-7-11.noarch.rpm | 15 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-11.noarch 1/2
Installing : remi-release-7.9-3.el7.remi.noarch 2/2
Verifying : remi-release-7.9-3.el7.remi.noarch 1/2
Verifying : epel-release-7-11.noarch 2/2
Installed:
remi-release.noarch 0:7.9-3.el7.remi
Dependency Installed:
epel-release.noarch 0:7-11
Complete!
[root@ホスト名~]#

Complete!と出ていれば成功しています。これでPHPをインストールする準備が完了しました。

PHPのインストール

下記コマンドとなります。

yum -y install −−enablerepo=remi-php80 php80 php80-php php80-php-xml php80-php-xmlrpc php80-php-pecl-mcrypt php80-php-fpm php80-php-pecl-apcu php80-php-mbstring php80-php-gd php80-php-json php80-php-pecl-json-post php80-php-pdo php80-php-mysqlnd php80-php-pecl-mysql php80-php-opcache php80-php-pear php80-php-soap php80-php-intl php80-php-pear

実行すると下記の通りです。

[root@ホスト名 ~]#
[root@ホスト名 ~]# yum -y install ??enablerepo=remi-php80 php80 php80-php php80-php-xml php80-php-xmlrpc php80-php-pecl-mcrypt php80-php-fpm php80-php-pecl-apcu php80-php-mbstring php80-php-gd php80-php-json php80-php-pecl-json-post php80-php-pdo php80-php-mysqlnd php80-php-pecl-mysql php80-php-opcache php80-php-pear php80-php-soap php80-php-intl php80-php-pear
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 7.5 kB 00:00:00
epel: ftp.jaist.ac.jp
extras: ftp.jaist.ac.jp
remi-safe: ftp.riken.jp
updates: ftp.jaist.ac.jp
epel | 4.7 kB 00:00:00
remi-safe | 3.0 kB 00:00:00
(1/4): epel/x86_64/group_gz | 96 kB 00:00:00
(2/4): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(3/4): epel/x86_64/primary_db | 7.0 MB 00:00:00
(4/4): remi-safe/primary_db | 2.1 MB 00:00:01
base/7/x86_64/filelists_db | 7.2 MB 00:00:00
epel/x86_64/filelists_db | 12 MB 00:00:01
extras/7/x86_64/filelists_db | 277 kB 00:00:00
remi-safe/filelists_db | 1.6 MB 00:00:00
updates/7/x86_64/filelists_db | 8.2 MB 00:00:00
No package ??enablerepo=remi-php80 available.
Resolving Dependencies
--> Running transaction check
---> Package php80.x86_64 0:1.0-3.el7.remi will be installed
--> Processing Dependency: php80-runtime(x86-64) = 1.0-3.el7.remi for package: php80-1.0-3.el7.remi.x86_64
--> Processing Dependency: php80-runtime for package: php80-1.0-3.el7.remi.x86_64
--> Processing Dependency: php80-php-cli(x86-64) for package: php80-1.0-3.el7.remi.x86_64
---> Package php80-php.x86_64 0:8.0.18-1.el7.remi will be installed
--> Processing Dependency: php80-php-sodium(x86-64) = 8.0.18-1.el7.remi for package: php80-php-8.0.18-1.el7.remi.x86_64
---> Package php80-php-common.x86_64 0:8.0.18-1.el7.remi will be installed
---> Package php80-php-fpm.x86_64 0:8.0.18-1.el7.remi will be installed
---> Package php80-php-gd.x86_64 0:8.0.18-1.el7.remi will be installed
--> Processing Dependency: libgd.so.103()(64bit) for package: php80-php-gd-8.0.18-1.el7.remi.x86_64
---> Package php80-php-intl.x86_64 0:8.0.18-1.el7.remi will be installed
--> Processing Dependency: libicudata.so.69()(64bit) for package: php80-php-intl-8.0.18-1.el7.remi.x86_64
--> Processing Dependency: libicui18n.so.69()(64bit) for package: php80-php-intl-8.0.18-1.el7.remi.x86_64
--> Processing Dependency: libicuio.so.69()(64bit) for package: php80-php-intl-8.0.18-1.el7.remi.x86_64
--> Processing Dependency: libicuuc.so.69()(64bit) for package: php80-php-intl-8.0.18-1.el7.remi.x86_64
---> Package php80-php-mbstring.x86_64 0:8.0.18-1.el7.remi will be installed
--> Processing Dependency: libonig.so.105()(64bit) for package: php80-php-mbstring-8.0.18-1.el7.remi.x86_64
---> Package php80-php-mysqlnd.x86_64 0:8.0.18-1.el7.remi will be installed
---> Package php80-php-opcache.x86_64 0:8.0.18-1.el7.remi will be installed
---> Package php80-php-pdo.x86_64 0:8.0.18-1.el7.remi will be installed
---> Package php80-php-pear.noarch 1:1.10.13-1.el7.remi will be installed
--> Processing Dependency: php80-php-posix for package: 1:php80-php-pear-1.10.13-1.el7.remi.noarch
---> Package php80-php-pecl-apcu.x86_64 0:5.1.21-1.el7.remi will be installed
---> Package php80-php-pecl-json-post.x86_64 0:1.1.0-1.el7.remi will be installed
---> Package php80-php-pecl-mcrypt.x86_64 0:1.0.4-1.el7.remi will be installed
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: php80-php-pecl-mcrypt-1.0.4-1.el7.remi.x86_64
---> Package php80-php-pecl-mysql.x86_64 0:1.0.0-0.24.20201210.6ca4fa4.el7.remi will be installed
---> Package php80-php-pecl-xmlrpc.x86_64 0:1.0.0~rc3-1.el7.remi will be installed
---> Package php80-php-soap.x86_64 0:8.0.18-1.el7.remi will be installed
---> Package php80-php-xml.x86_64 0:8.0.18-1.el7.remi will be installed
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: php80-php-xml-8.0.18-1.el7.remi.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: php80-php-xml-8.0.18-1.el7.remi.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: php80-php-xml-8.0.18-1.el7.remi.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: php80-php-xml-8.0.18-1.el7.remi.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: php80-php-xml-8.0.18-1.el7.remi.x86_64
--> Processing Dependency: libexslt.so.0()(64bit) for package: php80-php-xml-8.0.18-1.el7.remi.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: php80-php-xml-8.0.18-1.el7.remi.x86_64
--> Running transaction check
---> Package gd3php.x86_64 0:2.3.3-4.el7.remi will be installed
--> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: gd3php-2.3.3-4.el7.remi.x86_64
--> Processing Dependency: libtiff.so.5(LIBTIFF_4.0)(64bit) for package: gd3php-2.3.3-4.el7.remi.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: gd3php-2.3.3-4.el7.remi.x86_64
--> Processing Dependency: libXpm.so.4()(64bit) for package: gd3php-2.3.3-4.el7.remi.x86_64
--> Processing Dependency: libfontconfig.so.1()(64bit) for package: gd3php-2.3.3-4.el7.remi.x86_64
--> Processing Dependency: libjpeg.so.62()(64bit) for package: gd3php-2.3.3-4.el7.remi.x86_64
--> Processing Dependency: libraqm.so.0()(64bit) for package: gd3php-2.3.3-4.el7.remi.x86_64
--> Processing Dependency: libtiff.so.5()(64bit) for package: gd3php-2.3.3-4.el7.remi.x86_64
--> Processing Dependency: libwebp.so.7()(64bit) for package: gd3php-2.3.3-4.el7.remi.x86_64
---> Package libicu69.x86_64 0:69.1-2.el7.remi will be installed
---> Package libmcrypt.x86_64 0:2.5.8-13.el7 will be installed
---> Package libxslt.x86_64 0:1.1.28-6.el7 will be installed
---> Package oniguruma5php.x86_64 0:6.9.8-1.el7.remi will be installed
---> Package php80-php-cli.x86_64 0:8.0.18-1.el7.remi will be installed
---> Package php80-php-process.x86_64 0:8.0.18-1.el7.remi will be installed
---> Package php80-php-sodium.x86_64 0:8.0.18-1.el7.remi will be installed
--> Processing Dependency: libsodium.so.23()(64bit) for package: php80-php-sodium-8.0.18-1.el7.remi.x86_64
---> Package php80-runtime.x86_64 0:1.0-3.el7.remi will be installed
--> Processing Dependency: /usr/sbin/semanage for package: php80-runtime-1.0-3.el7.remi.x86_64
--> Processing Dependency: environment-modules for package: php80-runtime-1.0-3.el7.remi.x86_64
--> Processing Dependency: scl-utils for package: php80-runtime-1.0-3.el7.remi.x86_64
--> Running transaction check
---> Package environment-modules.x86_64 0:3.2.10-10.el7 will be installed
--> Processing Dependency: libtcl8.5.so()(64bit) for package: environment-modules-3.2.10-10.el7.x86_64
---> Package fontconfig.x86_64 0:2.13.0-4.3.el7 will be installed
--> Processing Dependency: fontpackages-filesystem for package: fontconfig-2.13.0-4.3.el7.x86_64
--> Processing Dependency: dejavu-sans-fonts for package: fontconfig-2.13.0-4.3.el7.x86_64
---> Package libX11.x86_64 0:1.6.7-4.el7_9 will be installed
--> Processing Dependency: libX11-common >= 1.6.7-4.el7_9 for package: libX11-1.6.7-4.el7_9.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.6.7-4.el7_9.x86_64
---> Package libXpm.x86_64 0:3.5.12-1.el7 will be installed
---> Package libjpeg-turbo.x86_64 0:1.2.90-8.el7 will be installed
---> Package libraqm.x86_64 0:0.7.0-4.el7 will be installed
--> Processing Dependency: libfribidi.so.0()(64bit) for package: libraqm-0.7.0-4.el7.x86_64
--> Processing Dependency: libharfbuzz.so.0()(64bit) for package: libraqm-0.7.0-4.el7.x86_64
---> Package libsodium.x86_64 0:1.0.18-1.el7 will be installed
---> Package libtiff.x86_64 0:4.0.3-35.el7 will be installed
--> Processing Dependency: libjbig.so.2.0()(64bit) for package: libtiff-4.0.3-35.el7.x86_64
---> Package libwebp7.x86_64 0:1.0.3-1.el7.remi will be installed
---> Package policycoreutils-python.x86_64 0:2.5-34.el7 will be installed
--> Processing Dependency: setools-libs >= 3.3.8-4 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libsemanage-python >= 2.5-14 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libselinux-python for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libcgroup for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
---> Package scl-utils.x86_64 0:20130529-19.el7 will be installed
--> Running transaction check
---> Package audit-libs-python.x86_64 0:2.8.5-4.el7 will be installed
---> Package checkpolicy.x86_64 0:2.5-8.el7 will be installed
---> Package dejavu-sans-fonts.noarch 0:2.33-6.el7 will be installed
--> Processing Dependency: dejavu-fonts-common = 2.33-6.el7 for package: dejavu-sans-fonts-2.33-6.el7.noarch
---> Package fontpackages-filesystem.noarch 0:1.44-8.el7 will be installed
---> Package fribidi.x86_64 0:1.0.2-1.el7_7.1 will be installed
---> Package harfbuzz.x86_64 0:1.7.5-2.el7 will be installed
--> Processing Dependency: libgraphite2.so.3()(64bit) for package: harfbuzz-1.7.5-2.el7.x86_64
---> Package jbigkit-libs.x86_64 0:2.0-11.el7 will be installed
---> Package libX11-common.noarch 0:1.6.7-4.el7_9 will be installed
---> Package libcgroup.x86_64 0:0.41-21.el7 will be installed
---> Package libselinux-python.x86_64 0:2.5-15.el7 will be installed
---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be installed
---> Package libxcb.x86_64 0:1.13-1.el7 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.13-1.el7.x86_64
---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be installed
---> Package tcl.x86_64 1:8.5.13-8.el7 will be installed
--> Running transaction check
---> Package dejavu-fonts-common.noarch 0:2.33-6.el7 will be installed
---> Package graphite2.x86_64 0:1.3.10-1.el7_3 will be installed
---> Package libXau.x86_64 0:1.0.8-2.1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================
Package Arch Version Repository Size
Installing:
php80 x86_64 1.0-3.el7.remi remi-safe 2.8 k
php80-php x86_64 8.0.18-1.el7.remi remi-safe 1.8 M
php80-php-common x86_64 8.0.18-1.el7.remi remi-safe 718 k
php80-php-fpm x86_64 8.0.18-1.el7.remi remi-safe 1.8 M
php80-php-gd x86_64 8.0.18-1.el7.remi remi-safe 92 k
php80-php-intl x86_64 8.0.18-1.el7.remi remi-safe 197 k
php80-php-mbstring x86_64 8.0.18-1.el7.remi remi-safe 488 k
php80-php-mysqlnd x86_64 8.0.18-1.el7.remi remi-safe 198 k
php80-php-opcache x86_64 8.0.18-1.el7.remi remi-safe 553 k
php80-php-pdo x86_64 8.0.18-1.el7.remi remi-safe 132 k
php80-php-pear noarch 1:1.10.13-1.el7.remi remi-safe 364 k
php80-php-pecl-apcu x86_64 5.1.21-1.el7.remi remi-safe 69 k
php80-php-pecl-json-post x86_64 1.1.0-1.el7.remi remi-safe 16 k
php80-php-pecl-mcrypt x86_64 1.0.4-1.el7.remi remi-safe 23 k
php80-php-pecl-mysql x86_64 1.0.0-0.24.20201210.6ca4fa4.el7.remi remi-safe 29 k
php80-php-pecl-xmlrpc x86_64 1.0.0~rc3-1.el7.remi remi-safe 47 k
php80-php-soap x86_64 8.0.18-1.el7.remi remi-safe 183 k
php80-php-xml x86_64 8.0.18-1.el7.remi remi-safe 179 k
Installing for dependencies:
audit-libs-python x86_64 2.8.5-4.el7 base 76 k
checkpolicy x86_64 2.5-8.el7 base 295 k
dejavu-fonts-common noarch 2.33-6.el7 base 64 k
dejavu-sans-fonts noarch 2.33-6.el7 base 1.4 M
environment-modules x86_64 3.2.10-10.el7 base 107 k
fontconfig x86_64 2.13.0-4.3.el7 base 254 k
fontpackages-filesystem noarch 1.44-8.el7 base 9.9 k
fribidi x86_64 1.0.2-1.el7_7.1 base 79 k
gd3php x86_64 2.3.3-4.el7.remi remi-safe 138 k
graphite2 x86_64 1.3.10-1.el7_3 base 115 k
harfbuzz x86_64 1.7.5-2.el7 base 267 k
jbigkit-libs x86_64 2.0-11.el7 base 46 k
libX11 x86_64 1.6.7-4.el7_9 updates 607 k
libX11-common noarch 1.6.7-4.el7_9 updates 164 k
libXau x86_64 1.0.8-2.1.el7 base 29 k
libXpm x86_64 3.5.12-1.el7 base 55 k
libcgroup x86_64 0.41-21.el7 base 66 k
libicu69 x86_64 69.1-2.el7.remi remi-safe 9.6 M
libjpeg-turbo x86_64 1.2.90-8.el7 base 135 k
libmcrypt x86_64 2.5.8-13.el7 epel 99 k
libraqm x86_64 0.7.0-4.el7 epel 15 k
libselinux-python x86_64 2.5-15.el7 base 236 k
libsemanage-python x86_64 2.5-14.el7 base 113 k
libsodium x86_64 1.0.18-1.el7 epel 147 k
libtiff x86_64 4.0.3-35.el7 base 172 k
libwebp7 x86_64 1.0.3-1.el7.remi remi-safe 266 k
libxcb x86_64 1.13-1.el7 base 214 k
libxslt x86_64 1.1.28-6.el7 base 242 k
oniguruma5php x86_64 6.9.8-1.el7.remi remi-safe 207 k
php80-php-cli x86_64 8.0.18-1.el7.remi remi-safe 3.6 M
php80-php-process x86_64 8.0.18-1.el7.remi remi-safe 91 k
php80-php-sodium x86_64 8.0.18-1.el7.remi remi-safe 87 k
php80-runtime x86_64 1.0-3.el7.remi remi-safe 1.1 M
policycoreutils-python x86_64 2.5-34.el7 base 457 k
python-IPy noarch 0.75-6.el7 base 32 k
scl-utils x86_64 20130529-19.el7 base 24 k
setools-libs x86_64 3.3.8-4.el7 base 620 k
tcl x86_64 1:8.5.13-8.el7 base 1.9 M
Transaction Summary
Install 18 Packages (+38 Dependent packages)
Total download size: 30 M
Installed size: 96 M
Downloading packages:
(1/56): audit-libs-python-2.8.5-4.el7.x86_64.rpm | 76 kB 00:00:00
(2/56): dejavu-fonts-common-2.33-6.el7.noarch.rpm | 64 kB 00:00:00
(3/56): environment-modules-3.2.10-10.el7.x86_64.rpm | 107 kB 00:00:00
(4/56): fontconfig-2.13.0-4.3.el7.x86_64.rpm | 254 kB 00:00:00
(5/56): fontpackages-filesystem-1.44-8.el7.noarch.rpm | 9.9 kB 00:00:00
(6/56): fribidi-1.0.2-1.el7_7.1.x86_64.rpm | 79 kB 00:00:00
(7/56): graphite2-1.3.10-1.el7_3.x86_64.rpm | 115 kB 00:00:00
(8/56): harfbuzz-1.7.5-2.el7.x86_64.rpm | 267 kB 00:00:00
(9/56): jbigkit-libs-2.0-11.el7.x86_64.rpm | 46 kB 00:00:00
(10/56): checkpolicy-2.5-8.el7.x86_64.rpm | 295 kB 00:00:00
(11/56): libX11-1.6.7-4.el7_9.x86_64.rpm | 607 kB 00:00:00
(12/56): libXau-1.0.8-2.1.el7.x86_64.rpm | 29 kB 00:00:00
(13/56): libXpm-3.5.12-1.el7.x86_64.rpm | 55 kB 00:00:00
(14/56): libcgroup-0.41-21.el7.x86_64.rpm | 66 kB 00:00:00
(15/56): libjpeg-turbo-1.2.90-8.el7.x86_64.rpm | 135 kB 00:00:00
warning: /var/cache/yum/x86_64/7/epel/packages/libmcrypt-2.5.8-13.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for libmcrypt-2.5.8-13.el7.x86_64.rpm is not installed
(16/56): libmcrypt-2.5.8-13.el7.x86_64.rpm | 99 kB 00:00:00
(17/56): libraqm-0.7.0-4.el7.x86_64.rpm | 15 kB 00:00:00
(18/56): dejavu-sans-fonts-2.33-6.el7.noarch.rpm | 1.4 MB 00:00:00
(19/56): libselinux-python-2.5-15.el7.x86_64.rpm | 236 kB 00:00:00
warning: /var/cache/yum/x86_64/7/remi-safe/packages/gd3php-2.3.3-4.el7.remi.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
Public key for gd3php-2.3.3-4.el7.remi.x86_64.rpm is not installed
(20/56): gd3php-2.3.3-4.el7.remi.x86_64.rpm | 138 kB 00:00:00
(21/56): libX11-common-1.6.7-4.el7_9.noarch.rpm | 164 kB 00:00:00
(22/56): libsodium-1.0.18-1.el7.x86_64.rpm | 147 kB 00:00:00
(23/56): libxcb-1.13-1.el7.x86_64.rpm | 214 kB 00:00:00
(24/56): libxslt-1.1.28-6.el7.x86_64.rpm | 242 kB 00:00:00
(25/56): libwebp7-1.0.3-1.el7.remi.x86_64.rpm | 266 kB 00:00:00
(26/56): libsemanage-python-2.5-14.el7.x86_64.rpm | 113 kB 00:00:00
(27/56): libtiff-4.0.3-35.el7.x86_64.rpm | 172 kB 00:00:00
(28/56): php80-1.0-3.el7.remi.x86_64.rpm | 2.8 kB 00:00:00
(29/56): php80-php-cli-8.0.18-1.el7.remi.x86_64.rpm | 3.6 MB 00:00:00
(30/56): php80-php-fpm-8.0.18-1.el7.remi.x86_64.rpm | 1.8 MB 00:00:00
(31/56): php80-php-gd-8.0.18-1.el7.remi.x86_64.rpm | 92 kB 00:00:00
(32/56): php80-php-intl-8.0.18-1.el7.remi.x86_64.rpm | 197 kB 00:00:00
(33/56): libicu69-69.1-2.el7.remi.x86_64.rpm | 9.6 MB 00:00:02
(34/56): php80-php-mbstring-8.0.18-1.el7.remi.x86_64.rpm | 488 kB 00:00:00
(35/56): php80-php-mysqlnd-8.0.18-1.el7.remi.x86_64.rpm | 198 kB 00:00:00
(36/56): php80-php-opcache-8.0.18-1.el7.remi.x86_64.rpm | 553 kB 00:00:00
(37/56): php80-php-pdo-8.0.18-1.el7.remi.x86_64.rpm | 132 kB 00:00:00
(38/56): php80-php-pecl-apcu-5.1.21-1.el7.remi.x86_64.rpm | 69 kB 00:00:00
(39/56): php80-php-pear-1.10.13-1.el7.remi.noarch.rpm | 364 kB 00:00:00
(40/56): oniguruma5php-6.9.8-1.el7.remi.x86_64.rpm | 207 kB 00:00:02
(41/56): php80-php-pecl-json-post-1.1.0-1.el7.remi.x86_64.rpm | 16 kB 00:00:00
(42/56): php80-php-pecl-mcrypt-1.0.4-1.el7.remi.x86_64.rpm | 23 kB 00:00:00
(43/56): php80-php-common-8.0.18-1.el7.remi.x86_64.rpm | 718 kB 00:00:01
(44/56): php80-php-pecl-xmlrpc-1.0.0~rc3-1.el7.remi.x86_64.rpm | 47 kB 00:00:00
(45/56): php80-php-pecl-mysql-1.0.0-0.24.20201210.6ca4fa4.el7.remi.x86_64.rpm | 29 kB 00:00:00
(46/56): php80-php-soap-8.0.18-1.el7.remi.x86_64.rpm | 183 kB 00:00:00
(47/56): php80-php-process-8.0.18-1.el7.remi.x86_64.rpm | 91 kB 00:00:00
(48/56): php80-php-sodium-8.0.18-1.el7.remi.x86_64.rpm | 87 kB 00:00:00
(49/56): php80-php-xml-8.0.18-1.el7.remi.x86_64.rpm | 179 kB 00:00:00
(50/56): python-IPy-0.75-6.el7.noarch.rpm | 32 kB 00:00:00
(51/56): php80-runtime-1.0-3.el7.remi.x86_64.rpm | 1.1 MB 00:00:00
(52/56): scl-utils-20130529-19.el7.x86_64.rpm | 24 kB 00:00:00
(53/56): setools-libs-3.3.8-4.el7.x86_64.rpm | 620 kB 00:00:00
(54/56): policycoreutils-python-2.5-34.el7.x86_64.rpm | 457 kB 00:00:00
(55/56): tcl-8.5.13-8.el7.x86_64.rpm | 1.9 MB 00:00:00
(56/56): php80-php-8.0.18-1.el7.remi.x86_64.rpm | 1.8 MB 00:00:04

Total 5.1 MB/s | 30 MB 00:00:05
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Importing GPG key 0x00F97F56:
Userid : "Remi Collet RPMS@FamilleCollet.com"
Fingerprint: 1ee0 4cce 88a4 ae4a a29a 5df5 004e 6f47 00f9 7f56
Package : remi-release-7.9-3.el7.remi.noarch (@/remi-release-7)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid : "Fedora EPEL (7) epel@fedoraproject.org"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release-7-11.noarch (@extras)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libjpeg-turbo-1.2.90-8.el7.x86_64 1/56
Installing : fontpackages-filesystem-1.44-8.el7.noarch 2/56
Installing : dejavu-fonts-common-2.33-6.el7.noarch 3/56
Installing : dejavu-sans-fonts-2.33-6.el7.noarch 4/56
Installing : fontconfig-2.13.0-4.3.el7.x86_64 5/56
Installing : libX11-common-1.6.7-4.el7_9.noarch 6/56
Installing : libcgroup-0.41-21.el7.x86_64 7/56
Installing : libwebp7-1.0.3-1.el7.remi.x86_64 8/56
Installing : libicu69-69.1-2.el7.remi.x86_64 9/56
Installing : graphite2-1.3.10-1.el7_3.x86_64 10/56
Installing : harfbuzz-1.7.5-2.el7.x86_64 11/56
Installing : libxslt-1.1.28-6.el7.x86_64 12/56
Installing : libXau-1.0.8-2.1.el7.x86_64 13/56
Installing : libxcb-1.13-1.el7.x86_64 14/56
Installing : libX11-1.6.7-4.el7_9.x86_64 15/56
Installing : libXpm-3.5.12-1.el7.x86_64 16/56
Installing : scl-utils-20130529-19.el7.x86_64 17/56
Installing : libmcrypt-2.5.8-13.el7.x86_64 18/56
Installing : jbigkit-libs-2.0-11.el7.x86_64 19/56
Installing : libtiff-4.0.3-35.el7.x86_64 20/56
Installing : audit-libs-python-2.8.5-4.el7.x86_64 21/56
Installing : libselinux-python-2.5-15.el7.x86_64 22/56
Installing : libsemanage-python-2.5-14.el7.x86_64 23/56
Installing : libsodium-1.0.18-1.el7.x86_64 24/56
Installing : setools-libs-3.3.8-4.el7.x86_64 25/56
Installing : oniguruma5php-6.9.8-1.el7.remi.x86_64 26/56
Installing : fribidi-1.0.2-1.el7_7.1.x86_64 27/56
Installing : libraqm-0.7.0-4.el7.x86_64 28/56
Installing : gd3php-2.3.3-4.el7.remi.x86_64 29/56
Installing : python-IPy-0.75-6.el7.noarch 30/56
Installing : checkpolicy-2.5-8.el7.x86_64 31/56
Installing : policycoreutils-python-2.5-34.el7.x86_64 32/56
Installing : 1:tcl-8.5.13-8.el7.x86_64 33/56
Installing : environment-modules-3.2.10-10.el7.x86_64 34/56
Installing : php80-runtime-1.0-3.el7.remi.x86_64 35/56
Installing : php80-php-common-8.0.18-1.el7.remi.x86_64 36/56
Installing : php80-php-cli-8.0.18-1.el7.remi.x86_64 37/56
Installing : php80-php-xml-8.0.18-1.el7.remi.x86_64 38/56
Installing : php80-php-sodium-8.0.18-1.el7.remi.x86_64 39/56
Installing : php80-php-process-8.0.18-1.el7.remi.x86_64 40/56
Installing : php80-php-pdo-8.0.18-1.el7.remi.x86_64 41/56
Installing : php80-php-mysqlnd-8.0.18-1.el7.remi.x86_64 42/56
Installing : php80-php-pecl-mysql-1.0.0-0.24.20201210.6ca4fa4.el7.remi.x86_64 43/56
Installing : 1:php80-php-pear-1.10.13-1.el7.remi.noarch 44/56
Installing : php80-php-8.0.18-1.el7.remi.x86_64 45/56
Installing : php80-php-pecl-xmlrpc-1.0.0~rc3-1.el7.remi.x86_64 46/56
Installing : php80-1.0-3.el7.remi.x86_64 47/56
Installing : php80-php-gd-8.0.18-1.el7.remi.x86_64 48/56
Installing : php80-php-pecl-mcrypt-1.0.4-1.el7.remi.x86_64 49/56
Installing : php80-php-mbstring-8.0.18-1.el7.remi.x86_64 50/56
Installing : php80-php-pecl-apcu-5.1.21-1.el7.remi.x86_64 51/56
Installing : php80-php-intl-8.0.18-1.el7.remi.x86_64 52/56
Installing : php80-php-pecl-json-post-1.1.0-1.el7.remi.x86_64 53/56
Installing : php80-php-soap-8.0.18-1.el7.remi.x86_64 54/56
Installing : php80-php-opcache-8.0.18-1.el7.remi.x86_64 55/56
Installing : php80-php-fpm-8.0.18-1.el7.remi.x86_64 56/56
Verifying : libXpm-3.5.12-1.el7.x86_64 1/56
Verifying : 1:tcl-8.5.13-8.el7.x86_64 2/56
Verifying : php80-1.0-3.el7.remi.x86_64 3/56
Verifying : gd3php-2.3.3-4.el7.remi.x86_64 4/56
Verifying : environment-modules-3.2.10-10.el7.x86_64 5/56
Verifying : php80-php-sodium-8.0.18-1.el7.remi.x86_64 6/56
Verifying : php80-php-pecl-xmlrpc-1.0.0~rc3-1.el7.remi.x86_64 7/56
Verifying : fontconfig-2.13.0-4.3.el7.x86_64 8/56
Verifying : php80-php-pecl-mysql-1.0.0-0.24.20201210.6ca4fa4.el7.remi.x86_64 9/56
Verifying : fontpackages-filesystem-1.44-8.el7.noarch 10/56
Verifying : php80-php-common-8.0.18-1.el7.remi.x86_64 11/56
Verifying : php80-php-gd-8.0.18-1.el7.remi.x86_64 12/56
Verifying : php80-php-pecl-mcrypt-1.0.4-1.el7.remi.x86_64 13/56
Verifying : checkpolicy-2.5-8.el7.x86_64 14/56
Verifying : php80-php-mbstring-8.0.18-1.el7.remi.x86_64 15/56
Verifying : php80-php-pecl-apcu-5.1.21-1.el7.remi.x86_64 16/56
Verifying : libtiff-4.0.3-35.el7.x86_64 17/56
Verifying : php80-php-intl-8.0.18-1.el7.remi.x86_64 18/56
Verifying : dejavu-fonts-common-2.33-6.el7.noarch 19/56
Verifying : python-IPy-0.75-6.el7.noarch 20/56
Verifying : fribidi-1.0.2-1.el7_7.1.x86_64 21/56
Verifying : php80-runtime-1.0-3.el7.remi.x86_64 22/56
Verifying : libxcb-1.13-1.el7.x86_64 23/56
Verifying : policycoreutils-python-2.5-34.el7.x86_64 24/56
Verifying : oniguruma5php-6.9.8-1.el7.remi.x86_64 25/56
Verifying : setools-libs-3.3.8-4.el7.x86_64 26/56
Verifying : php80-php-process-8.0.18-1.el7.remi.x86_64 27/56
Verifying : libjpeg-turbo-1.2.90-8.el7.x86_64 28/56
Verifying : libsodium-1.0.18-1.el7.x86_64 29/56
Verifying : dejavu-sans-fonts-2.33-6.el7.noarch 30/56
Verifying : harfbuzz-1.7.5-2.el7.x86_64 31/56
Verifying : libsemanage-python-2.5-14.el7.x86_64 32/56
Verifying : php80-php-pecl-json-post-1.1.0-1.el7.remi.x86_64 33/56
Verifying : libselinux-python-2.5-15.el7.x86_64 34/56
Verifying : php80-php-pdo-8.0.18-1.el7.remi.x86_64 35/56
Verifying : php80-php-soap-8.0.18-1.el7.remi.x86_64 36/56
Verifying : audit-libs-python-2.8.5-4.el7.x86_64 37/56
Verifying : jbigkit-libs-2.0-11.el7.x86_64 38/56
Verifying : libraqm-0.7.0-4.el7.x86_64 39/56
Verifying : libmcrypt-2.5.8-13.el7.x86_64 40/56
Verifying : php80-php-xml-8.0.18-1.el7.remi.x86_64 41/56
Verifying : php80-php-8.0.18-1.el7.remi.x86_64 42/56
Verifying : scl-utils-20130529-19.el7.x86_64 43/56
Verifying : 1:php80-php-pear-1.10.13-1.el7.remi.noarch 44/56
Verifying : libXau-1.0.8-2.1.el7.x86_64 45/56
Verifying : libxslt-1.1.28-6.el7.x86_64 46/56
Verifying : libX11-1.6.7-4.el7_9.x86_64 47/56
Verifying : graphite2-1.3.10-1.el7_3.x86_64 48/56
Verifying : libicu69-69.1-2.el7.remi.x86_64 49/56
Verifying : php80-php-opcache-8.0.18-1.el7.remi.x86_64 50/56
Verifying : libwebp7-1.0.3-1.el7.remi.x86_64 51/56
Verifying : php80-php-fpm-8.0.18-1.el7.remi.x86_64 52/56
Verifying : libcgroup-0.41-21.el7.x86_64 53/56
Verifying : php80-php-cli-8.0.18-1.el7.remi.x86_64 54/56
Verifying : libX11-common-1.6.7-4.el7_9.noarch 55/56
Verifying : php80-php-mysqlnd-8.0.18-1.el7.remi.x86_64 56/56

Installed:
php80.x86_64 0:1.0-3.el7.remi
php80-php.x86_64 0:8.0.18-1.el7.remi
php80-php-common.x86_64 0:8.0.18-1.el7.remi
php80-php-fpm.x86_64 0:8.0.18-1.el7.remi
php80-php-gd.x86_64 0:8.0.18-1.el7.remi
php80-php-intl.x86_64 0:8.0.18-1.el7.remi
php80-php-mbstring.x86_64 0:8.0.18-1.el7.remi
php80-php-mysqlnd.x86_64 0:8.0.18-1.el7.remi
php80-php-opcache.x86_64 0:8.0.18-1.el7.remi
php80-php-pdo.x86_64 0:8.0.18-1.el7.remi
php80-php-pear.noarch 1:1.10.13-1.el7.remi
php80-php-pecl-apcu.x86_64 0:5.1.21-1.el7.remi
php80-php-pecl-json-post.x86_64 0:1.1.0-1.el7.remi
php80-php-pecl-mcrypt.x86_64 0:1.0.4-1.el7.remi
php80-php-pecl-mysql.x86_64 0:1.0.0-0.24.20201210.6ca4fa4.el7.remi
php80-php-pecl-xmlrpc.x86_64 0:1.0.0~rc3-1.el7.remi
php80-php-soap.x86_64 0:8.0.18-1.el7.remi
php80-php-xml.x86_64 0:8.0.18-1.el7.remi

Dependency Installed:
audit-libs-python.x86_64 0:2.8.5-4.el7 checkpolicy.x86_64 0:2.5-8.el7
dejavu-fonts-common.noarch 0:2.33-6.el7 dejavu-sans-fonts.noarch 0:2.33-6.el7
environment-modules.x86_64 0:3.2.10-10.el7 fontconfig.x86_64 0:2.13.0-4.3.el7
fontpackages-filesystem.noarch 0:1.44-8.el7 fribidi.x86_64 0:1.0.2-1.el7_7.1
gd3php.x86_64 0:2.3.3-4.el7.remi graphite2.x86_64 0:1.3.10-1.el7_3
harfbuzz.x86_64 0:1.7.5-2.el7 jbigkit-libs.x86_64 0:2.0-11.el7
libX11.x86_64 0:1.6.7-4.el7_9 libX11-common.noarch 0:1.6.7-4.el7_9
libXau.x86_64 0:1.0.8-2.1.el7 libXpm.x86_64 0:3.5.12-1.el7
libcgroup.x86_64 0:0.41-21.el7 libicu69.x86_64 0:69.1-2.el7.remi
libjpeg-turbo.x86_64 0:1.2.90-8.el7 libmcrypt.x86_64 0:2.5.8-13.el7
libraqm.x86_64 0:0.7.0-4.el7 libselinux-python.x86_64 0:2.5-15.el7
libsemanage-python.x86_64 0:2.5-14.el7 libsodium.x86_64 0:1.0.18-1.el7
libtiff.x86_64 0:4.0.3-35.el7 libwebp7.x86_64 0:1.0.3-1.el7.remi
libxcb.x86_64 0:1.13-1.el7 libxslt.x86_64 0:1.1.28-6.el7
oniguruma5php.x86_64 0:6.9.8-1.el7.remi php80-php-cli.x86_64 0:8.0.18-1.el7.remi
php80-php-process.x86_64 0:8.0.18-1.el7.remi php80-php-sodium.x86_64 0:8.0.18-1.el7.remi
php80-runtime.x86_64 0:1.0-3.el7.remi policycoreutils-python.x86_64 0:2.5-34.el7
python-IPy.noarch 0:0.75-6.el7 scl-utils.x86_64 0:20130529-19.el7
setools-libs.x86_64 0:3.3.8-4.el7 tcl.x86_64 1:8.5.13-8.el7

Complete!
[root@ホスト名 ~]#

Complete!と出ていればインストールは成功です。

PHPのVersion確認

php -v  👈PHPのVersionを確認するコマンド

すると。

[root@ホスト名 ~]# php -v
-bash: php: command not found  👈出ません。
[root@ホスト名 ~]#

シンボリックリンクを張る必要があります。

which php80  👈PHPのインストールされた場所を確認する

こうなります

[root@ホスト名 ~]# which php80
/usr/bin/php80  👈PHPのインストールされた場所です。
[root@ホスト名 ~]#

シンボリックリンクを貼りましょう。

ln -sf /usr/bin/php80 /usr/bin/php  👈シンボリックリンクを貼ります。

実行すると下記のようになります。またphp -vまで実行します。

[root@ホスト名 ~]# ln -sf /usr/bin/php80 /usr/bin/php
[root@ホスト名 ~]#
[root@ホスト名 ~]# php -v  👈確認できました!
PHP 8.0.18 (cli) (built: Apr 13 2022 02:45:05) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.18, Copyright (c) Zend Technologies
with Zend OPcache v8.0.18, Copyright (c), by Zend Technologies
[root@ホスト名 ~]#

PHPの設定を変えましょう


PHPの設定を変更するには下記コマンドで可能です。

[root@ホスト名 ~]# vi /etc/opt/remi/php80/php.ini

アップロードサイズの変更を行う

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 8M  👈ここを変えます。
; Automatically add files before PHP document.
; http://php.net/auto-prepend-file
auto_prepend_file =

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 32M  👈ここを変えました。
; Automatically add files before PHP document.
; http://php.net/auto-prepend-file
auto_prepend_file =

; Automatically add files before PHP document.
; http://php.net/auto-prepend-file
auto_prepend_file =

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
;upload_tmp_dir =
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M  👈ここを変えます。
; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
;upload_tmp_dir =
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 32M  👈ここを変えました。
; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

[CLI Server]
; Whether the CLI web server uses ANSI color coding in its terminal output.
cli_server.color = On

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =  👈ここを変えます。

; http://php.net/date.default-latitude
;date.default_latitude = 31.7667

[CLI Server]
; Whether the CLI web server uses ANSI color coding in its terminal output.
cli_server.color = On

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =“Asia/Tokyo” 👈ここを変えました。

; http://php.net/date.default-latitude
;date.default_latitude = 31.7667

; http://php.net/date.default-longitude
;date.default_longitude = 35.2333

:wq と入力し保存します。

再起動しましょう。

systemctl restart httpd

PHPの稼働確認

稼働しているか確認のため、info.phpを作成し、「http://サーバIPアドレス/info.php」をブラウザで表示させてみましょう。

[root@ホスト名 ~]#
[root@ホスト名 ~]# vi /var/www/html/info.php
[root@ホスト名 ~]#
[root@ホスト名 ~]# systemctl restart httpd
[root@ホスト名 ~]#

WEBブラウザに「http://サーバIPアドレス/info.php」を表示させてみましょう。

上記のような画面が出れば成功です!

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です