首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在ubuntu 22.10上安装php7.4

在ubuntu 22.10上安装php7.4
EN

Ask Ubuntu用户
提问于 2022-10-30 08:17:46
回答 4查看 12.1K关注 0票数 12

我跟随本教程在Ubuntu22.10上安装php7.4。

据我所知,我只需要添加这个PPA并用

代码语言:javascript
复制
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

然后将php7.4与

代码语言:javascript
复制
sudo apt-get instal php7.4

但是,我得到了这个错误:

代码语言:javascript
复制
nugroho@vostro:~$ sudo apt-get update
Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease
Ign:2 https://ppa.launchpadcontent.net/ondrej/php/ubuntu kinetic InRelease
Err:3 https://ppa.launchpadcontent.net/ondrej/php/ubuntu kinetic Release
  404  Not Found [IP: 185.125.190.52 443]
Hit:4 http://archive.ubuntu.com/ubuntu kinetic InRelease   
Get:5 http://archive.ubuntu.com/ubuntu kinetic-updates InRelease [90,7 kB]
Hit:6 http://archive.ubuntu.com/ubuntu kinetic-backports InRelease
Get:7 http://archive.ubuntu.com/ubuntu kinetic-security InRelease [90,7 kB]
Reading package lists... Done    
E: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu kinetic 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.

代码语言:javascript
复制
nugroho@vostro:~$ sudo apt-get install php7.4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package php7.4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php7.4' has no installation candidate

是在Ubuntu22.10上还没有支持php7.4,还是我犯了一个错误?

下面是有关我的安装的一些详细信息:

代码语言:javascript
复制
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.10
Release:    22.10
Codename:   kinetic
EN

回答 4

Ask Ubuntu用户

回答已采纳

发布于 2022-11-02 07:09:08

这里有几个元素在起作用。

首先,PHP版本默认遵循Ubuntu。因此,在Ubuntu22.10上安装除8之外的任何PHP都是非默认的。

一种方法是使用ppa:ondrej/php。但是,每个发行版都需要更新PPA,22.10个版本还没有更新。

另一种选择是安装PHP (可能还有Apache等)。用容器。在这种情况下,PHP版本可以独立于系统。

不建议使用任何其他手动安装非默认PHP版本,因为从长远来看,它可能会导致包依赖问题。

票数 7
EN

Ask Ubuntu用户

发布于 2022-12-27 13:42:09

我遵循了下面的步骤,结果很好!(感谢项目警报reddit链接)

在从22.04升级到22.10和PHP5.6之后,我也遇到了同样的问题。(在我的例子中,php7.4)我通过更改/etc/apt/sources.list.d/ondrej-ubuntu-php-kinetic.list来解决这个问题。

代码语言:javascript
复制
deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main
#deb-src https://ppa.launchpadcontent.net/ondrej/php/ubuntu/kinetic main

当然,运行apt update命令

票数 14
EN

Ask Ubuntu用户

发布于 2022-10-31 10:28:46

我通过手动(使用dpkg install)从Ubuntu https://packages.ubuntu.com/jammy/amd64/libicu70/download下载和安装libicu70库解决了同样的问题。

然后sudo apt install php7.4-intl进行得很顺利。

编辑依赖问题只是在我忘记提到的第一步之后才出现的:在jammy中使用kinetic而不是在ppa:ondrej/php中作为kinetic还不能从PPA中获得。(请注意,整个答案的预期寿命很短。)

票数 2
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1438143

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档