ホームページ  >  記事  >  バックエンド開発  >  Ubuntu への PHP /+ のインストール

Ubuntu への PHP /+ のインストール

PHPz
PHPzオリジナル
2024-08-20 06:55:31701ブラウズ

Installing PHP /+ on ubuntu


と同様のエラーが発生する可能性があります

Hit:1 http://ng.archive.ubuntu.com/ubuntu lunar InRelease                      
Hit:2 http://ng.archive.ubuntu.com/ubuntu lunar-updates InRelease              
Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease                  
Hit:4 http://ng.archive.ubuntu.com/ubuntu lunar-backports InRelease
Ign:5 https://ppa.launchpadcontent.net/ondrej/php/ubuntu lunar InRelease
Err:6 https://ppa.launchpadcontent.net/ondrej/php/ubuntu lunar Release
  404  Not Found [IP: 185.125.190.80 443]
Hit:7 http://ng.archive.ubuntu.com/ubuntu lunar-security InRelease
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu lunar Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

or 

“Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package php8.2
E: Couldn’t find any package by glob ‘php8.2’
E: Couldn’t find any package by regex ‘php8.2’”

おそらくランニング後

add-apt-repository ppa:ondrej/php

実行して以前のソースを削除します

sudo add-apt-repository --remove ppa:ondrej/php
sudo apt update

リポジトリのソース ファイルを次のように編集する必要があります:

sudo nano /etc/apt/sources.list

と入力してください

deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main

それから実行してください

sudo apt update

その後、例として 8.3 を使用して PHP バージョンをインストールできるようになります

sudo apt install php8.3

すでに他の PHP がインストールされている場合は、
を使用してバージョンに変更する必要がある場合があります。

sudo update-alternatives --config php

プロンプトに従います。

次の拡張機能のインストールを検討することもできます

sudo apt install php8.3-curl php8.3-gd php8.3-intl php8.3-simplexml php8.3-dom php8.3-mysql php8.3-mbstring php8.3-xml php8.3-gd php8.3-curl php8.3-mysqli php8.3-zip

以上がUbuntu への PHP /+ のインストールの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。