1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

CentOS 8にPHP 7.3, PHP-FPM 7.3をインストール(AppStream)

Posted at

はじめに

Application Stream(AppStream)を利用してCentOS8にPHP7.3をインストール
親記事:PHP, PHP-FPMの各種インストール方法とEOLまとめ
参考:RHEL8のパッケージ構成 - BaseOSとApplication Stream - 赤帽エンジニアブログ

サポート

本手法で導入した場合、Red Hat Enterprise Linux 8 Application Streams Life Cycle - Red Hat Customer Portalより、2021-11がEOLだと思われる。
それ以降に報告された脆弱性や不具合への対応は実施されない可能性がある。

LOG

インストール

# cat /etc/redhat-release
CentOS Linux release 8.1.1911 (Core)

# yum install -y @php:7.3/common
... 略

php-fpm起動/停止

# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

# systemctl start php-fpm
# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
   Active: active (running) since Sat 2020-01-18 06:55:36 UTC; 4s ago
 Main PID: 236 (php-fpm)
   Status: "Ready to handle connections"
    Tasks: 6 (limit: 8989)
   Memory: 19.1M
   CGroup: /docker/91caa1db0c51e1c2f44f1270ff89519b5af389e9d5594b0bdbde9e68b9a0c03b/system.slice/php-fpm.serv>
           tq236 php-fpm: master process (/etc/php-fpm.conf)
           tq237 php-fpm: pool www
           tq238 php-fpm: pool www
           tq239 php-fpm: pool www
           tq240 php-fpm: pool www
           mq241 php-fpm: pool www

Jan 18 06:55:36 91caa1db0c51 systemd[1]: Starting The PHP FastCGI Process Manager...
Jan 18 06:55:36 91caa1db0c51 systemd[1]: Started The PHP FastCGI Process Manager.
# systemctl stop php-fpm
# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

Jan 18 06:55:36 91caa1db0c51 systemd[1]: Starting The PHP FastCGI Process Manager...
Jan 18 06:55:36 91caa1db0c51 systemd[1]: Started The PHP FastCGI Process Manager.
Jan 18 06:59:38 91caa1db0c51 systemd[1]: Stopping The PHP FastCGI Process Manager...
Jan 18 06:59:38 91caa1db0c51 systemd[1]: Stopped The PHP FastCGI Process Manager.

php-fpm自動起動設定/設定解除

# systemctl enable php-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.

# systemctl list-unit-files --type=service |grep php-fpm
php-fpm.service                        enabled
# systemctl disable php-fpm
Removed /etc/systemd/system/multi-user.target.wants/php-fpm.service.

# systemctl list-unit-files --type=service |grep php-fpm
php-fpm.service                        disabled

各種確認

# which php
/usr/bin/php

# php -v
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

# php -i | grep php.ini
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.in

# which php-fpm
/usr/sbin/php-fpm

# /usr/sbin/php-fpm -v
PHP 7.3.5 (fpm-fcgi) (built: Apr 30 2019 08:37:17)
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies

# yum module info php:7.3
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:11:45 ago on Sat Jan 18 06:49:39 2020.
Name         : php
Stream       : 7.3 [e] [a]
Version      : 8010020191122191516
Context      : 2430b045
Architecture : x86_64
Profiles     : common [i], devel, minimal
Repo         : AppStream
Summary      : PHP scripting language
Description  : php 7.3 module
Artifacts    : apcu-panel-0:5.1.17-1.module_el8.1.0+252+0d4e049c.noarch
             : libzip-0:1.5.2-1.module_el8.1.0+252+0d4e049c.src
             : libzip-0:1.5.2-1.module_el8.1.0+252+0d4e049c.x86_64
             : libzip-debuginfo-0:1.5.2-1.module_el8.1.0+252+0d4e049c.x86_64
             : libzip-debugsource-0:1.5.2-1.module_el8.1.0+252+0d4e049c.x86_64
             : libzip-devel-0:1.5.2-1.module_el8.1.0+252+0d4e049c.x86_64
             : libzip-tools-0:1.5.2-1.module_el8.1.0+252+0d4e049c.x86_64
             : libzip-tools-debuginfo-0:1.5.2-1.module_el8.1.0+252+0d4e049c.x86_64
             : php-0:7.3.5-3.module_el8.1.0+252+0d4e049c.src
             : php-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-bcmath-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-bcmath-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-cli-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-cli-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-common-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-common-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-dba-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-dba-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-dbg-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-dbg-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-debugsource-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-devel-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-embedded-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-embedded-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-enchant-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-enchant-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-fpm-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-fpm-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-gd-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-gd-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-gmp-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-gmp-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-intl-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-intl-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-json-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-json-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-ldap-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-ldap-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-mbstring-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-mbstring-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-mysqlnd-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-mysqlnd-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-odbc-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-odbc-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-opcache-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-opcache-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-pdo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-pdo-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-pear-1:1.10.9-1.module_el8.1.0+252+0d4e049c.noarch
             : php-pear-1:1.10.9-1.module_el8.1.0+252+0d4e049c.src
             : php-pecl-apcu-0:5.1.17-1.module_el8.1.0+252+0d4e049c.src
             : php-pecl-apcu-0:5.1.17-1.module_el8.1.0+252+0d4e049c.x86_64
             : php-pecl-apcu-debuginfo-0:5.1.17-1.module_el8.1.0+252+0d4e049c.x86_64
             : php-pecl-apcu-debugsource-0:5.1.17-1.module_el8.1.0+252+0d4e049c.x86_64
             : php-pecl-apcu-devel-0:5.1.17-1.module_el8.1.0+252+0d4e049c.x86_64
             : php-pecl-zip-0:1.15.4-1.module_el8.1.0+252+0d4e049c.src
             : php-pecl-zip-0:1.15.4-1.module_el8.1.0+252+0d4e049c.x86_64
             : php-pecl-zip-debuginfo-0:1.15.4-1.module_el8.1.0+252+0d4e049c.x86_64
             : php-pecl-zip-debugsource-0:1.15.4-1.module_el8.1.0+252+0d4e049c.x86_64
             : php-pgsql-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-pgsql-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-process-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-process-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-recode-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-recode-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-snmp-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-snmp-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-soap-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-soap-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-xml-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-xml-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-xmlrpc-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64
             : php-xmlrpc-debuginfo-0:7.3.5-3.module_el8.1.0+252+0d4e049c.x86_64

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled, [a]ctive
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?