差分
このページの2つのバージョン間の差分を表示します。
| 次のリビジョン | 前のリビジョン | ||
| ja:documentation:pandorafms:technical_annexes:18_php_8 [2023/03/01 08:09] – 作成 - 外部編集 127.0.0.1 | ja:documentation:pandorafms:technical_annexes:18_php_8 [2025/02/20 02:36] (現在) – [前提条件] junichi | ||
|---|---|---|---|
| 行 4: | 行 4: | ||
| [[ja: | [[ja: | ||
| + | |||
| + | <wrap #ks1 /> | ||
| ===== 前提条件 ===== | ===== 前提条件 ===== | ||
| - | * Open a terminal window with the **root** | + | * Open a terminal window with user **root** |
| + | * Verify that version 7.x is installed. | ||
| + | * It is recommended to perform a [[: | ||
| - | * **root** ユーザでターミナルウィンドウを開き、次のコマンドを入力します。 | + | * **root** ユーザでターミナルウィンドウを開き、'' |
| + | * バージョン 7.x がインストールされていることを確認します。 | ||
| + | * [[: | ||
| - | <code> | + | <wrap #ks2 /> |
| - | php --version | + | ===== Rocky Linux 8/AlmaLinux 8/RHEL 8 ===== |
| + | |||
| + | <wrap #ks2_1 /> | ||
| + | |||
| + | ==== PHP 8.0 へのアップデート ==== | ||
| + | |||
| + | * Configure the repositories: | ||
| + | |||
| + | * リポジトリの設定: | ||
| + | |||
| + | <code bash> | ||
| + | dnf module reset php -y | ||
| + | dnf -y module enable php: | ||
| </ | </ | ||
| - | You will get an answer similar to the following: | + | * Install PHP: |
| - | 次のような応答が得られます。 | + | * PHP のインストール: |
| - | < | + | < |
| - | PHP 7.4.29 (cli) (built: Apr 12 2022 10:55:38) ( NTS ) | + | dnf install -y \ |
| - | Copyright (c) The PHP Group | + | php php-mcrypt php-cli php-gd \ |
| - | Zend Engine v3.4.0, Copyright (c) Zend Technologies | + | php-curl php-session php-mysqlnd \ |
| + | php-ldap php-zip php-zlib php-fileinfo \ | ||
| + | php-gettext php-snmp php-mbstring \ | ||
| + | php-pecl-zip php-xmlrpc \ | ||
| + | php-xml php-yaml | ||
| </ | </ | ||
| - | * Perform a data backup procedure. See "[[:en: | + | * Restart php-fpm '' |
| + | * Verify the version installed: '' | ||
| - | * データバックアップ手順を実施します。詳細は、[[:ja: | + | * php-fpm の再起動: |
| - | + | * インストールバージョンの確認: '' | |
| - | ===== CentOS 7 ===== | + | |
| - | * Configure the repositories: | + | <wrap #ks2_2 /> |
| - | * リポジトリを設定します。 | + | ==== PHP 8.2 へのアップデート ==== |
| - | < | + | |
| - | yum -y install https:// | + | <code bash> |
| - | yum -y install https:// | + | dnf module reset php -y |
| - | yum -y install yum-utils | + | dnf -y module enable php:remi-8.2 |
| - | yum-config-manager | + | |
| - | yum-config-manager | + | dnf install |
| + | php php-mcrypt php-cli php-gd \ | ||
| + | php-curl php-session php-mysqlnd \ | ||
| + | php-ldap php-zip php-zlib php-fileinfo \ | ||
| + | php-gettext php-snmp php-mbstring \ | ||
| + | php-pecl-zip php-xmlrpc \ | ||
| + | php-xml php-yaml | ||
| + | |||
| + | systemctl restart php-fpm | ||
| </ | </ | ||
| - | * Install PHP 8 and its dependencies: | + | <wrap #ks3 /> |
| - | * PHP 8 とその依存ファイルをインストールします。 | + | ===== Ubuntu server 22.04 ===== |
| - | < | + | |
| - | yum install -y \ | + | |
| - | php php-mcrypt php-cli php-gd php-curl php-mysql \ | + | |
| - | | + | |
| - | | + | |
| - | </code> | + | < |
| + | dpkg -l | grep php | tee packages.txt | ||
| + | # Remove old PHP | ||
| + | # When upgrading from older PHP version: | ||
| + | a2disconf php8.1-fpm 2> /dev/null | ||
| + | a2disconf php8.0-fpm 2> /dev/null | ||
| + | dpkg -l | grep php | awk ' | ||
| - | < | ||
| - | systemctl restart httpd | ||
| - | </code> | + | ## Define new php |
| + | export DEBIAN_FRONTEND=noninteractive | ||
| + | export NEEDRESTART_SUSPEND=1 | ||
| + | export PHPVER=" | ||
| + | add-apt-repository ppa:ondrej/php | ||
| + | apt update | ||
| + | apt install -y php$PHPVER php$PHPVER-fpm php$PHPVER-common \ | ||
| + | php$PHPVER-cli libapache2-mod-fcgid apache2 \ | ||
| + | php$PHPVER-bz2 php$PHPVER-mbstring php$PHPVER-intl | ||
| + | php$PHPVER-gd | ||
| + | php$PHPVER-fileinfo php$PHPVER-gettext php$PHPVER-snmp php$PHPVER-mbstring \ | ||
| + | php$PHPVER-zip php$PHPVER-xmlrpc php$PHPVER-xml php$PHPVER-yaml | ||
| - | * Verify the version installed with: | + | a2enmod proxy_fcgi setenvif |
| + | a2enconf php$PHPVER-fpm | ||
| - | | + | ## Prepare php config |
| - | < | + | rm -f / |
| - | php --version | + | ln -s / |
| + | sed --follow-symlinks -i -e " | ||
| + | sed --follow-symlinks -i -e " | ||
| + | sed --follow-symlinks -i -e " | ||
| + | sed --follow-symlinks -i -e " | ||
| + | sed --follow-symlinks -i -e " | ||
| + | sed --follow-symlinks -i -e " | ||
| + | |||
| + | systemctl enable php$PHPVER-fpm --now | ||
| + | systemctl restart php$PHPVER-fpm | ||
| + | systemctl restart apache2 | ||
| </ | </ | ||
| - | You will get an answer similar to the following: | + | [[ja:documentation: |
| - | 次のような応答が得られます。 | ||
| - | < | ||
| - | PHP 8.0.19 (cli) (built: May 10 2022 08:07:35) ( NTS gcc x86_64 ) | ||
| - | Copyright (c) The PHP Group | ||
| - | Zend Engine v4.0.19, Copyright (c) Zend Technologies | ||
| - | </ | ||
| - | ===== RHEL 7 ===== | + | ===== (OBSOLETE) CentOS |
| - | <WRAP center round tip 75%> | + | <WRAP center round info 90%> |
| - | To upgrade to PHP 8 in RHEL 7 [[https:// | + | The end-of-life of the CentOS 7 operating system is June 2024. |
| </ | </ | ||
| - | <WRAP center round tip 75%> | + | <WRAP center round info 90%> |
| - | RHEL 7 で PHP 8 にアップグレードするには、[[https:// | + | CentOS |
| </ | </ | ||
| - | ===== Rocky Linux 8/AlmaLinux 8/RHEL 8 ===== | + | <wrap #ks4_1 /> |
| + | |||
| + | ==== CentOS 7 での PHP 8.0 へのアップデート | ||
| * Configure the repositories: | * Configure the repositories: | ||
| * リポジトリを設定します。 | * リポジトリを設定します。 | ||
| - | < | + | |
| - | dnf module reset php -y | + | < |
| - | dnf module enable php:remi-8.0 | + | |
| + | yum -y install https:// | ||
| + | yum -y install https:// | ||
| + | yum -y install yum-utils | ||
| + | yum-config-manager --disable ' | ||
| + | yum-config-manager --enable remi-php80 | ||
| </ | </ | ||
| - | * Install PHP: | + | * Install PHP 8 and its dependencies: |
| - | * PHP をインストールします。 | + | * PHP 8 とその依存ファイルをインストールします。 |
| - | <code bash> | + | |
| - | dnf install -y php php-fpm | + | |
| + | < | ||
| + | yum install -y \ | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| </ | </ | ||
| - | * Install dependencies: | + | * Restart the web server: '' |
| + | * Verify the version installed with: '' | ||
| - | * 依存ファイルをインストールします。 | + | * ウェブサーバの再起動: |
| - | < | + | * インストールバージョンの確認: |
| - | dnf install | + | |
| - | php-cli php-fpm php-curl php-mysqlnd php-gd php-opcache php-zip \ | + | <wrap #ks4_2 /> |
| - | php-intl php-common php-bcmath php-imap php-imagick php-xmlrpc \ | + | |
| - | php-json php-readline php-memcached php-redis php-mbstring | + | ==== CentOS 7 での PHP 8.2 へのアップデート ==== |
| - | php-xml php-dom php-redis php-memcached php-memcache | + | |
| + | * Configure the repositories: | ||
| + | |||
| + | * リポジトリを設定します。 | ||
| + | |||
| + | < | ||
| + | |||
| + | yum -y install https:// | ||
| + | yum -y install https:// | ||
| + | yum -y install yum-utils | ||
| + | yum-config-manager | ||
| + | yum-config-manager | ||
| </ | </ | ||
| - | * Restart php-fpm | + | * Install PHP 8 and its dependencies: |
| - | * php-ftm | + | * PHP 8 とその依存ファイルをインストールします。 |
| - | < | + | < |
| - | systemctl restart | + | yum install -y \ |
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| </ | </ | ||
| + | * Restart the web server: '' | ||
| + | * Verify the version installed with: '' | ||
| - | * Verify the version installed: | + | * ウェブサーバの再起動: '' |
| + | * インストールバージョンの確認: | ||
| - | * インストールしたバージョンを確認します。 | + | <wrap #ks5 /> |
| - | <code bash> | + | |
| - | php --version | + | |
| - | </ | + | ===== RHEL 7 ===== |
| - | You will get an answer similar to the following: | + | <WRAP center round tip 75%> |
| - | 次のような応答が得られます。 | + | To upgrade to PHP 8 in RHEL 7 [[https:// |
| + | |||
| + | </ | ||
| + | |||
| + | <WRAP center round tip 75%> | ||
| + | |||
| + | RHEL 7 で PHP 8 にアップグレードするには、[[https:// | ||
| + | |||
| + | </ | ||
| - | < | ||
| - | PHP 8.0.19 (cli) (built: May 10 2022 08:07:35) ( NTS gcc x86_64 ) | ||
| - | Copyright (c) The PHP Group | ||
| - | Zend Engine v4.0.19, Copyright (c) Zend Technologies | ||
| - | </ | ||
| [[ja: | [[ja: | ||