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?

AlmaLinux PHP 対応メモ

1
Posted at

AlmaLinux上で PHP 8.0.30 のセキュリティ対応

1. 入手元を確認

まずPHPの入手元を確認。8.0.30はPHP 8.0系の最終版で、本家のサポートは2023年11月に終了。そのため、パッチを受け取れるかどうかは入手元で決まる。

cat /etc/almalinux-release
rpm -qi php-common | grep -E 'Version|Release|Vendor|From repo'
dnf list installed 'php*'

Release の末尾(el9 / el8 / remi など)を見て判断。

2. 入手元別の対応

A. AlmaLinux 9 標準の AppStream(例: 8.0.30-x.el9)

RHEL 9 の標準PHPは8.0で、OSのライフサイクル中(2032年まで)はセキュリティ修正がバックポートされる。バージョン番号は8.0.30のまま、Release番号だけが上がる。
この場合は次のコマンドだけでOK。

sudo dnf update 'php*'
sudo systemctl restart php-fpm 

適用済みのCVEは rpm -q --changelog php-common | head -50 で確認できる。

B. AlmaLinux 8 の php:8.0 モジュール

このストリームはすでにサポートが終了しており、更新はできない。php:8.2 などへ切り替える必要あり。

dnf module list php
sudo dnf module reset php
sudo dnf module enable php:8.2
sudo dnf distro-sync

C. Remi リポジトリなどの外部リポジトリ

8.0系は基本的にEOL。8.2や8.3以降へ移行。

3. 確実にパッチを受けたい場合

A以外のケースでは、8.2以上へのアップグレードが実質的に唯一の方法。移行前には次の点を確認。

非推奨機能の利用(動的プロパティ、${var} 形式の文字列展開など)
拡張モジュールの有無(php -m の結果を移行前後で比較)
ステージング環境での動作確認

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?