PHPのバージョンアップ


アップデート前環境概要
:CentOSバージョン
[root@falcon21 ~]# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)


---------------------

Apacheバージョン

[root@falcon21 ~]# httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built: Aug 8 2019 11:41:18


2.4.6から最新バージョンへアップグレード

パッケージを確認
[root@falcon21 ~]# yum list | grep httpd
httpd.x86_64 2.4.6-90.el7.centos @base
httpd-devel.x86_64 2.4.6-90.el7.centos @base
httpd-tools.x86_64 2.4.6-90.el7.centos @base
httpd24-libcurl.x86_64 7.61.1-2.el7 @centos-sclo-rh
httpd24-libcurl-devel.x86_64 7.61.1-2.el7 @centos-sclo-rh
httpd24-libnghttp2.x86_64 1.7.1-8.el7 @centos-sclo-rh
httpd24-runtime.x86_64 1.1-19.el7 @centos-sclo-rh
darkhttpd.x86_64 1.11-1.el7 epel
dmlite-apache-httpd.x86_64 1.14.2-1.el7 epel
httpd.x86_64 2.4.6-95.el7.centos base
httpd-devel.x86_64 2.4.6-95.el7.centos base
httpd-itk.x86_64 2.4.7.04-2.el7 epel
httpd-manual.noarch 2.4.6-95.el7.centos base
httpd-tools.x86_64 2.4.6-95.el7.centos base
httpd24.x86_64 1.1-19.el7 centos-sclo-rh
httpd24-build.x86_64 1.1-19.el7 centos-sclo-rh
httpd24-curl.x86_64 7.61.1-2.el7 centos-sclo-rh
httpd24-httpd.x86_64 2.4.34-18.el7.1 centos-sclo-rh
httpd24-httpd-devel.x86_64 2.4.34-18.el7.1 centos-sclo-rh
httpd24-httpd-manual.noarch 2.4.34-18.el7.1 centos-sclo-rh
httpd24-httpd-tools.x86_64 2.4.34-18.el7.1 centos-sclo-rh
httpd24-libnghttp2.x86_64 1.7.1-8.el7.1 centos-sclo-rh
httpd24-libnghttp2-devel.x86_64 1.7.1-8.el7.1 centos-sclo-rh
httpd24-mlogc.x86_64 2.9.3-4.el7 centos-sclo-rh
httpd24-mod_auth_kerb.x86_64 5.4-33.el7 centos-sclo-rh
httpd24-mod_auth_mellon.x86_64 0.14.0-3.el7 centos-sclo-rh
httpd24-mod_auth_mellon-diagnostics.x86_64
httpd24-mod_ldap.x86_64 2.4.34-18.el7.1 centos-sclo-rh
httpd24-mod_md.x86_64 1:2.0.8-1.el7 centos-sclo-rh
httpd24-mod_proxy_html.x86_64 1:2.4.34-18.el7.1 centos-sclo-rh
httpd24-mod_security.x86_64 2.9.3-4.el7 centos-sclo-rh
httpd24-mod_session.x86_64 2.4.34-18.el7.1 centos-sclo-rh
httpd24-mod_ssl.x86_64 1:2.4.34-18.el7.1 centos-sclo-rh
httpd24-nghttp2.x86_64 1.7.1-8.el7.1 centos-sclo-rh
httpd24-scldevel.x86_64 1.1-19.el7 centos-sclo-rh
httpd24u.x86_64 2.4.46-1.el7.ius ius
httpd24u-devel.x86_64 2.4.46-1.el7.ius ius
httpd24u-filesystem.noarch 2.4.46-1.el7.ius ius
httpd24u-manual.noarch 2.4.46-1.el7.ius ius
httpd24u-mod_ldap.x86_64 2.4.46-1.el7.ius ius
httpd24u-mod_proxy_html.x86_64 1:2.4.46-1.el7.ius ius
httpd24u-mod_security2.x86_64 2.9.3-1.el7.ius ius
httpd24u-mod_security2-mlogc.x86_64 2.9.3-1.el7.ius ius
httpd24u-mod_session.x86_64 2.4.46-1.el7.ius ius
httpd24u-mod_ssl.x86_64 1:2.4.46-1.el7.ius ius
httpd24u-mod_xsendfile.x86_64 0.12-1.ius.el7 ius
httpd24u-tools.x86_64 2.4.46-1.el7.ius ius
iipsrv-httpd-fcgi.noarch 1.0.0-6.0.el7 epel
keycloak-httpd-client-install.noarch 0.8-1.el7 base
libmicrohttpd.i686 0.9.33-2.el7 base
libmicrohttpd.x86_64 0.9.33-2.el7 base
libmicrohttpd-devel.i686 0.9.33-2.el7 base
libmicrohttpd-devel.x86_64 0.9.33-2.el7 base
libmicrohttpd-doc.noarch 0.9.33-2.el7 base
lighttpd.x86_64 1.4.54-1.el7 epel
lighttpd-fastcgi.x86_64 1.4.54-1.el7 epel
lighttpd-mod_authn_gssapi.x86_64 1.4.54-1.el7 epel
lighttpd-mod_authn_mysql.x86_64 1.4.54-1.el7 epel
lighttpd-mod_authn_pam.x86_64 1.4.54-1.el7 epel
lighttpd-mod_geoip.x86_64 1.4.54-1.el7 epel
lighttpd-mod_mysql_vhost.x86_64 1.4.54-1.el7 epel
mini_httpd.x86_64 1.25-1 lux
mirmon-httpd.noarch 2.11-1.el7 epel
opensips-httpd.x86_64 1.10.5-4.el7 epel
owncloud-httpd.noarch 9.1.5-1.el7 epel
pagure-web-apache-httpd.noarch 5.11.3-2.el7 epel
php72u-fpm-httpd.noarch 7.2.34-1.el7.ius ius
php73-fpm-httpd.noarch 7.3.24-1.el7.ius ius
php74-fpm-httpd.noarch 7.4.12-1.el7.ius ius
phpMyAdmin49-httpd.noarch 4.9.5-1.el7.ius ius
phpMyAdmin50-httpd.noarch 5.0.2-3.el7.ius ius
python2-keycloak-httpd-client-install.noarch
python2-sphinxcontrib-httpdomain.noarch 1.7.0-1.el7 epel
radicale-httpd.noarch 1.1.2-1.el7 epel
sclo-httpd24-mod_auth_mellon.x86_64 0.12.0-2.el7 centos-sclo-sclo
sclo-httpd24-mod_ruid2.x86_64 0.9.8-5.el7 centos-sclo-sclo
sympa-httpd.x86_64 6.2.58-1.el7 epel
sympa-lighttpd.x86_64 6.2.58-1.el7 epel
sysusage-httpd.noarch 5.7-2.el7 epel
thttpd.x86_64 2.29-2.el7 epel
viewvc-httpd-fcgi.noarch 1.1.28-1.el7 epel
viewvc-httpd-wsgi.noarch 1.1.28-1.el7 epel
web-assets-httpd.noarch 5-1.el7 epel

・・・baseレポジトリでインストールできるApache httpdのバージョンは2.4.6 ・・・


epelレポジトリのインストール
[root@falcon21 ~]# yum install epel-release
362 packages excluded due to repository priority protections
一致したパッケージ epel-release-7-11.noarch はすでにインストールされています。更新を確認しています。


iusレポジトリ用パッケージのインストール     2020/11/15

> [root@falcon21 ~]# yum -y install "https://repo.ius.io/ius-release-el7.rpm"
読み込んだプラグイン:fastestmirror, langpacks, priorities, show-leaves
ius-release-el7.rpm | 8.2 kB 00:00:00
/var/tmp/yum-root-4IsFTN/ius-release-el7.rpm を調べています: ius-release-2-1.el7.ius.noarch
/var/tmp/yum-root-4IsFTN/ius-release-el7.rpm: インストールされたパッケージを更新しません。
エラー: 何もしません



[root@falcon21 ~]# vi /etc/yum.repos.d/ius.repo
1 [ius]
2 name = IUS for Enterprise Linux 7 - $basearch
3 baseurl = https://repo.ius.io/7/$basearch/
4 enabled = 0


依存関係のあるパッケージの追加
[root@falcon21 ~]# yum -y install openldap-devel expat-devel libdb-devel mailcap system-logos
更新:
expat-devel.x86_64 0:2.1.0-12.el7 openldap-devel.x86_64 0:2.4.44-22.el7

依存性を更新しました:
expat.x86_64 0:2.1.0-12.el7 openldap.x86_64 0:2.4.44-22.el7

完了しました!


httpdのインストール
[root@falcon21 ~]# yum -y install --disablerepo=base,extras,updates --enablerepo=ius httpd httpd-devel mod_ssl
エラー: httpd24u-devel conflicts with httpd-devel-2.4.6-90.el7.centos.x86_64
エラー: httpd24u conflicts with httpd-2.4.6-90.el7.centos.x86_64
エラー: httpd24u-tools conflicts with httpd-tools-2.4.6-90.el7.centos.x86_64
エラー: httpd24u-mod_ssl conflicts with 1:mod_ssl-2.4.6-90.el7.centos.x86_64
問題を回避するために --skip-broken を用いることができます。
これらを試行できます: rpm -Va --nofiles --nodigest

httpd削除してから、インストール
[root@falcon21 ~]# yum -y remove httpd-devel-2.4.6-90.el7.centos.x86_64 httpd-2.4.6-90.el7.centos.x86_64 httpd-tools-2.4.6-90.el7.centos.x86_64 mod_ssl-2.4.6-90.el7.centos.x86_64
httpd.x86_64 0:2.4.6-90.el7.centos httpd-devel.x86_64 0:2.4.6-90.el7.centos httpd-tools.x86_64 0:2.4.6-90.el7.centos
mod_ssl.x86_64 1:2.4.6-90.el7.centos

依存性の削除をしました:
mod_wsgi.x86_64 0:3.4-18.el7 php71-php.x86_64 0:7.1.33-7.el7.remi python2-certbot-apache.noarch 0:1.3.0-1.el7

完了しました!
New leaves:
apr-util-devel.x86_64
certbot.noarch

再インストール
[root@falcon21 ~]# yum -y install --disablerepo=base,extras,updates --enablerepo=ius httpd httpd-devel mod_ssl
インストール:
httpd24u.x86_64 0:2.4.46-1.el7.ius httpd24u-devel.x86_64 0:2.4.46-1.el7.ius httpd24u-mod_ssl.x86_64 1:2.4.46-1.el7.ius

依存性関連をインストールしました:
apr15u.x86_64 0:1.5.2-2.ius.el7 apr15u-devel.x86_64 0:1.5.2-2.ius.el7
apr15u-util.x86_64 0:1.5.4-3.ius.el7 apr15u-util-devel.x86_64 0:1.5.4-3.ius.el7
brotli.x86_64 0:1.0.7-5.el7 httpd24u-filesystem.noarch 0:2.4.46-1.el7.ius
httpd24u-tools.x86_64 0:2.4.46-1.el7.ius

完了しました!
New leaves:
httpd24u-devel.x86_64
httpd24u-mod_ssl.x86_64


httpdインストール後の確認
[root@falcon21 ~]# yum list installed | grep httpd
httpd24-libcurl.x86_64 7.61.1-2.el7 @centos-sclo-rh
httpd24-libcurl-devel.x86_64 7.61.1-2.el7 @centos-sclo-rh
httpd24-libnghttp2.x86_64 1.7.1-8.el7 @centos-sclo-rh
httpd24-runtime.x86_64 1.1-19.el7 @centos-sclo-rh
httpd24u.x86_64 2.4.46-1.el7.ius @ius
httpd24u-devel.x86_64 2.4.46-1.el7.ius @ius
httpd24u-filesystem.noarch 2.4.46-1.el7.ius @ius
httpd24u-mod_ssl.x86_64 1:2.4.46-1.el7.ius @ius
httpd24u-tools.x86_64 2.4.46-1.el7.ius @ius
[root@falcon21 ~]# httpd -v
Server version: Apache/2.4.46 (IUS)
Server built: Sep 26 2020 06:55:54


[root@falcon21 ~]# which httpd
/sbin/httpd


[root@falcon21 ~]# httpd -v
Server version: Apache/2.4.46 (IUS)
Server built: Sep 26 2020 06:55:54


httpd起動の確認
[root@falcon21 ~]# systemctl start httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

[root@falcon21 ~]# systemctl status httpd.service
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 日 2020-11-15 19:32:59 JST; 2min 28s ago
Docs: man:httpd.service(8)
Process: 9818 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 9818 (code=exited, status=1/FAILURE)
Status: "Reading configuration..."

11月 15 19:32:59 falcon21.space systemd[1]: Starting The Apache HTTP Server...
11月 15 19:32:59 falcon21.space httpd[9818]: AH00526: Syntax error on line 4 of /etc/httpd/conf.d/vhost.conf:
11月 15 19:32:59 falcon21.space httpd[9818]: No comments are allowed here
11月 15 19:32:59 falcon21.space systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
11月 15 19:32:59 falcon21.space systemd[1]: Failed to start The Apache HTTP Server.
11月 15 19:32:59 falcon21.space systemd[1]: Unit httpd.service entered failed state.
11月 15 19:32:59 falcon21.space systemd[1]: httpd.service failed.

----- /etc/httpd/conf.d/vhost.conf: --> No comments are allowed here --------
vhost.confの4行目、コメントを削除


[root@falcon21 ~]# systemctl restart httpd
[root@falcon21 ~]# systemctl status httpd
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since 日 2020-11-15 20:14:15 JST; 3min 45s ago
Docs: man:httpd.service(8)
Main PID: 12952 (httpd)
Status: "Total requests: 5; Idle/Busy workers 100/0;Requests/sec: 0.0228; Bytes served/sec: 64 B/sec"
Tasks: 53
CGroup: /system.slice/httpd.service
├─12952 /usr/sbin/httpd -DFOREGROUND
├─12959 /usr/sbin/httpd -DFOREGROUND
├─12960 /usr/sbin/httpd -DFOREGROUND
├─12961 /usr/sbin/httpd -DFOREGROUND
├─12967 /usr/sbin/httpd -DFOREGROUND
├─12968 /usr/sbin/httpd -DFOREGROUND
└─13033 /usr/sbin/httpd -DFOREGROUND

11月 15 20:14:15 falcon21.space systemd[1]: Starting The Apache HTTP Server...
11月 15 20:14:15 falcon21.space systemd[1]: Started The Apache HTTP Server.


ウェブサイト ・・・接続がプライベートではありません




***********************************************************************

PHPをバージョンアップする
[root@falcon21 ~]# cp /etc/php.ini /etc/php-old.ini ・・・後で戻す。


[root@falcon21 ~]# yum remove php-*
削除しました:
php.x86_64 0:7.3.24-1.el7.remi php-cli.x86_64 0:7.3.24-1.el7.remi php-common.x86_64 0:7.3.24-1.el7.remi
php-devel.x86_64 0:7.3.24-1.el7.remi php-gd.x86_64 0:7.3.24-1.el7.remi php-json.x86_64 0:7.3.24-1.el7.remi
php-mbstring.x86_64 0:7.3.24-1.el7.remi

完了しました!
New leaves:
libargon2-devel.x86_64
oniguruma5php.x86_64


[root@falcon21 ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm を取得中
準備しています... ################################# [100%]
パッケージ epel-release-7-12.noarch は既にインストールされています。


[root@falcon21 ~]# yum install --disablerepo=* --enablerepo=remi,remi-php71 php php-mbstring php-gd php-mycript
インストール:
php.x86_64 0:7.1.33-10.el7.remi php-gd.x86_64 0:7.1.33-10.el7.remi php-mbstring.x86_64 0:7.1.33-10.el7.remi

依存性関連をインストールしました:
php-cli.x86_64 0:7.1.33-10.el7.remi php-common.x86_64 0:7.1.33-10.el7.remi php-json.x86_64 0:7.1.33-10.el7.remi

完了しました!
New leaves:
php.x86_64
php-gd.x86_64
php-mbstring.x86_64



[root@falcon21 ~]# php -v
PHP 7.1.33 (cli) (built: Sep 29 2020 09:53:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies



[root@falcon21 ~]# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)



php-mysql をインストール
[root@falcon21 ~]# yum install --disablerepo=* --enablerepo=remi,remi-php71 php php-mysql php-mbstring php-gd
Running transaction
インストール中 : php-pdo-7.1.33-10.el7.remi.x86_64 1/2
インストール中 : php-mysqlnd-7.1.33-10.el7.remi.x86_64 2/2
検証中 : php-pdo-7.1.33-10.el7.remi.x86_64 1/2
検証中 : php-mysqlnd-7.1.33-10.el7.remi.x86_64 2/2

インストール:
php-mysqlnd.x86_64 0:7.1.33-10.el7.remi

依存性関連をインストールしました:
php-pdo.x86_64 0:7.1.33-10.el7.remi

完了しました!
New leaves:
php-mysqlnd.x86_64



php-xml をインストール
[root@falcon21 ~]# yum install --disablerepo=* --enablerepo=remi,remi-php71 php php-mysql php-mbstring php-gd php-xml


p
hp-pear をインストール
[root@falcon21 ~]# yum install --disablerepo=* --enablerepo=remi,remi-php71 php php-mysql php-mbstring php-gd php-mycrip php-xml php-pear
Running transaction
インストール中 : php-fedora-autoloader-1.0.1-2.el7.remi.noarch 1/3
インストール中 : php-process-7.1.33-10.el7.remi.x86_64 2/3
インストール中 : 1:php-pear-1.10.12-2.el7.remi.noarch 3/3
検証中 : php-process-7.1.33-10.el7.remi.x86_64 1/3
検証中 : 1:php-pear-1.10.12-2.el7.remi.noarch 2/3
検証中 : php-fedora-autoloader-1.0.1-2.el7.remi.noarch 3/3

インストール:
php-pear.noarch 1:1.10.12-2.el7.remi

依存性関連をインストールしました:
php-fedora-autoloader.noarch 0:1.0.1-2.el7.remi php-process.x86_64 0:7.1.33-10.el7.remi

完了しました!
New leaves:
php-pear.noarch


php-devel.をインストール
[root@falcon21 ~]# yum install --disablerepo=* --enablerepo=remi,remi-php71 php-devel
php-devel.x86_64 0:7.1.33-10.el7.remi

完了しました!
New leaves:
php-devel.x86_64


[root@falcon21 ~]# yum install --disablerepo=* --enablerepo=remi,remi-php71 php-mysqlnd php-intl
Running transaction
インストール中 : libicu65-65.1-1.el7.remi.x86_64 1/2
/sbin/ldconfig: /lib64/libnuma.so.1 はシンボリックリンクではありません

インストール中 : php-intl-7.1.33-10.el7.remi.x86_64 2/2
検証中 : libicu65-65.1-1.el7.remi.x86_64 1/2
検証中 : php-intl-7.1.33-10.el7.remi.x86_64 2/2

インストール:
php-intl.x86_64 0:7.1.33-10.el7.remi

依存性関連をインストールしました:
libicu65.x86_64 0:65.1-1.el7.remi

完了しました!
New leaves:
php-intl.x86_64




[root@falcon21 ~]# yum install --disablerepo=* --enablerepo=remi,remi-php71 php-mbstring php-mcrypt php-mysql php-mysql php-php-gettext.noarch php-process php-tcpdf

Running transaction
インストール中 : php-tidy-7.1.33-10.el7.remi.x86_64 1/5
インストール中 : php-bcmath-7.1.33-10.el7.remi.x86_64 2/5
インストール中 : php-tcpdf-6.3.5-1.el7.remi.noarch 3/5
インストール中 : php-php-gettext-1.0.12-1.el7.remi.noarch 4/5
インストール中 : php-mcrypt-7.1.33-10.el7.remi.x86_64 5/5
検証中 : php-tcpdf-6.3.5-1.el7.remi.noarch 1/5
検証中 : php-mcrypt-7.1.33-10.el7.remi.x86_64 2/5
検証中 : php-php-gettext-1.0.12-1.el7.remi.noarch 3/5
検証中 : php-bcmath-7.1.33-10.el7.remi.x86_64 4/5
検証中 : php-tidy-7.1.33-10.el7.remi.x86_64 5/5

インストール:
php-mcrypt.x86_64 0:7.1.33-10.el7.remi php-php-gettext.noarch 0:1.0.12-1.el7.remi php-tcpdf.noarch 0:6.3.5-1.el7.remi

依存性関連をインストールしました:
php-bcmath.x86_64 0:7.1.33-10.el7.remi php-tidy.x86_64 0:7.1.33-10.el7.remi

完了しました!
New leaves:
php-mcrypt.x86_64
php-php-gettext.noarch
php-tcpdf.noarch



[root@falcon21 ~]# yum install --disablerepo=* --enablerepo=remi,remi-php56 php-tcpdf-dejavu-sans-fonts.noarch php-tidy.x86_64
Transaction test succeeded
Running transaction
インストール中 : php-tcpdf-dejavu-sans-fonts-6.3.5-1.el7.remi.noarch 1/1
検証中 : php-tcpdf-dejavu-sans-fonts-6.3.5-1.el7.remi.noarch 1/1

インストール:
php-tcpdf-dejavu-sans-fonts.noarch 0:6.3.5-1.el7.remi

完了しました!
New leaves:
php-tcpdf-dejavu-sans-fonts.noarch




**************************************************************

/etc/httpd をバックアップファイルから戻す


ウェブサイト 表示OK。
 

投票数:0 平均点:0.00

 
Back to Top