AlmaLinux OS 9にPHP 8.1, PHP-FPM 8.1をインストール（AppStream）

# はじめに

Application Stream(AppStream)を利用してAlmaLinux OS 9にPHP 8.1をインストール
親記事：[PHP, PHP-FPMの各種インストール方法とEOLまとめ](https://qiita.com/witchcraze/items/dfe3823554b7caba6f6a)

## サポート

本手法で導入した場合、[Red Hat Enterprise Linux Application Streams Life Cycle \- Red Hat Customer Portal](https://access.redhat.com/support/policy/updates/rhel-app-streams-life-cycle)より、2025-05がEOLだと思われる。
それ以降に報告された脆弱性や不具合への対応は実施されない可能性がある。

## LOG

### インストール

9.0系で出たプロダクトはモジュールではなかったが、9.1系で出たプロダクトはモジュールの模様

```shell-session
# cat /etc/redhat-release
AlmaLinux release 9.1 (Lime Lynx)

# yum module list php
Last metadata expiration check: 0:04:20 ago on Fri Nov 18 06:46:38 2022.
AlmaLinux 9 - AppStream
Name             Stream             Profiles                               Summary
php              8.1                common [d], devel, minimal             PHP scripting language

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

# yum module install -y php:8.1
... 略
```

### 各種確認

```shell-session
# which php
/usr/bin/php

# php -v
PHP 8.1.8 (cli) (built: Jul  5 2022 21:55:55) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.8, Copyright (c) Zend Technologies

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

# php-fpm -v
PHP 8.1.8 (fpm-fcgi) (built: Jul  5 2022 21:55:55)
Copyright (c) The PHP Group
Zend Engine v4.1.8, Copyright (c) Zend Technologies

# yum info php
Last metadata expiration check: 0:06:09 ago on Fri Nov 18 06:46:38 2022.
Available Packages
Name         : php
Version      : 8.1.8
Release      : 1.module_el9.1.0+15+94ba28e4
Architecture : x86_64
Size         : 12 k
Source       : php-8.1.8-1.module_el9.1.0+15+94ba28e4.src.rpm
Repository   : appstream
Summary      : PHP scripting language for creating dynamic web sites
URL          : http://www.php.net/
License      : PHP and Zend and BSD and MIT and ASL 1.0 and NCSA and Boost
Description  : PHP is an HTML-embedded scripting language. PHP attempts to make it
             : easy for developers to write dynamically generated web pages. PHP also
             : offers built-in database integration for several commercial and
             : non-commercial database management systems, so writing a
             : database-enabled webpage with PHP is fairly simple. The most common
             : use of PHP coding is probably as a replacement for CGI scripts.

# yum info php-cli
Last metadata expiration check: 0:06:28 ago on Fri Nov 18 06:46:38 2022.
Installed Packages
Name         : php-cli
Version      : 8.1.8
Release      : 1.module_el9.1.0+15+94ba28e4
Architecture : x86_64
Size         : 16 M
Source       : php-8.1.8-1.module_el9.1.0+15+94ba28e4.src.rpm
Repository   : @System
From repo    : appstream
Summary      : Command-line interface for PHP
URL          : http://www.php.net/
License      : PHP and Zend and BSD and MIT and ASL 1.0 and NCSA and PostgreSQL
Description  : The php-cli package contains the command-line interface
             : executing PHP scripts, /usr/bin/php, and the CGI interface.

# yum info php-fpm
Last metadata expiration check: 0:06:39 ago on Fri Nov 18 06:46:38 2022.
Installed Packages
Name         : php-fpm
Version      : 8.1.8
Release      : 1.module_el9.1.0+15+94ba28e4
Architecture : x86_64
Size         : 8.2 M
Source       : php-8.1.8-1.module_el9.1.0+15+94ba28e4.src.rpm
Repository   : @System
From repo    : appstream
Summary      : PHP FastCGI Process Manager
URL          : http://www.php.net/
License      : PHP and Zend and BSD and MIT and ASL 1.0 and NCSA and Boost
Description  : PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI
             : implementation with some additional features useful for sites of
             : any size, especially busier sites.
```