CentOS 8에 PHP 7.3, PHP-FPM 7.3 설치(AppStream)

CentOS 8에 PHP 7.3, PHP-FPM 7.3 설치(AppStream)

2022-10-04 last update

11 minutes reading PHP appstream php-fpm centos8

소개



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