0
0

More than 3 years have passed since last update.

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

Last updated at Posted at 2019-09-25

はじめに

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

サポート

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

LOG

インストール

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

# yum install -y @php:7.2
... 略

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 Thu 2019-09-26 05:53:12 EDT; 4s ago
 Main PID: 1917 (php-fpm)
   Status: "Ready to handle connections"
    Tasks: 6 (limit: 11109)
   Memory: 19.8M
   CGroup: /system.slice/php-fpm.service
           tq1917 php-fpm: master process (/etc/php-fpm.conf)
           tq1918 php-fpm: pool www
           tq1919 php-fpm: pool www
           tq1920 php-fpm: pool www
           tq1921 php-fpm: pool www
           mq1922 php-fpm: pool www

Sep 26 05:53:12 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager...
Sep 26 05:53:12 localhost.localdomain 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)

Sep 26 05:53:12 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager...
Sep 26 05:53:12 localhost.localdomain systemd[1]: Started The PHP FastCGI Process Manager.
Sep 26 05:53:22 localhost.localdomain systemd[1]: Stopping The PHP FastCGI Process Manager...
Sep 26 05:53:22 localhost.localdomain 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.2.11 (cli) (built: Oct  9 2018 15:09:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

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

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

# /usr/sbin/php-fpm -v
PHP 7.2.11 (fpm-fcgi) (built: Oct  9 2018 15:09:36)
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

# yum module info php:7.2
Last metadata expiration check: 0:11:19 ago on Wed 25 Sep 2019 10:08:23 AM EDT.
Name             : php
Stream           : 7.2 [d][e][a]
Version          : 8000020190628155007
Context          : ad195792
Profiles         : common [d] [i], devel, minimal
Default profiles : common
Repo             : AppStream
Summary          : PHP scripting language
Description      : php 7.2 module
Artifacts        : apcu-panel-0:5.1.12-1.module_el8.0.0+56+d1ca79aa.noarch
                 : libzip-0:1.5.1-1.module_el8.0.0+56+d1ca79aa.src
                 : libzip-0:1.5.1-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : libzip-debuginfo-0:1.5.1-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : libzip-debugsource-0:1.5.1-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : libzip-devel-0:1.5.1-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : libzip-tools-0:1.5.1-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : libzip-tools-debuginfo-0:1.5.1-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.src
                 : php-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-bcmath-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-bcmath-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-cli-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-cli-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-common-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-common-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-dba-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-dba-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-dbg-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-dbg-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-debugsource-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-devel-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-embedded-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-embedded-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-enchant-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-enchant-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-fpm-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-fpm-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-gd-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-gd-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-gmp-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-gmp-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-intl-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-intl-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-json-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-json-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-ldap-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-ldap-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-mbstring-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-mbstring-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-mysqlnd-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-mysqlnd-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-odbc-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-odbc-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-opcache-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-opcache-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-pdo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-pdo-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-pear-1:1.10.5-8.module_el8.0.0+56+d1ca79aa.noarch
                 : php-pear-1:1.10.5-8.module_el8.0.0+56+d1ca79aa.src
                 : php-pecl-apcu-0:5.1.12-1.module_el8.0.0+56+d1ca79aa.src
                 : php-pecl-apcu-0:5.1.12-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-pecl-apcu-debuginfo-0:5.1.12-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-pecl-apcu-debugsource-0:5.1.12-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-pecl-apcu-devel-0:5.1.12-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-pecl-zip-0:1.15.3-1.module_el8.0.0+56+d1ca79aa.src
                 : php-pecl-zip-0:1.15.3-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-pecl-zip-debuginfo-0:1.15.3-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-pecl-zip-debugsource-0:1.15.3-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-pgsql-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-pgsql-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-process-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-process-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-recode-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-recode-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-snmp-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-snmp-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-soap-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-soap-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-xml-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-xml-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-xmlrpc-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64
                 : php-xmlrpc-debuginfo-0:7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled, [a]ctive]
0
0
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
0
0