在 ubuntu 14.04 上更新 PHP 版本

在 ubuntu 14.04 上更新 PHP 版本

我的 PHP 版本是 5.6.17,我想将其更新到 5.6.32。当我尝试运行时,apt-get update出现错误:

W: Failed to fetch http://ppa.launchpad.net/ondrej/php5-
5.6/ubuntu/dists/trusty/main/binary-amd64/Packages  403  Forbidden

W: Failed to fetch http://ppa.launchpad.net/ondrej/php5-
5.6/ubuntu/dists/trusty/main/binary-i386/Packages  403  Forbidden

/etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list

http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu

http://ppa.launchpad.net/ondrej/php/ubuntu

然后没有错误,但仍然没有更新。我该怎么办?

输出apt list --installed |grep php

libapache2-mod-php5/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 amd64 [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]
php-pear/now 5.5.9+dfsg-1ubuntu4.14 all [installed,upgradable to: 5.5.9+dfsg-1ubuntu4.22]
php5/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 all [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]
php5-cgi/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 amd64 [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]
php5-cli/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 amd64 [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]
php5-common/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 amd64 [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]
php5-curl/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 amd64 [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]
php5-fpm/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 amd64 [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]
php5-gd/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 amd64 [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]
php5-json/now 1.3.9-1+deb.sury.org~trusty+3 amd64 [installed,upgradable to: 1.3.9-1+deb.sury.org~trusty+4]
php5-mcrypt/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 amd64 [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]
php5-memcached/unknown,now 2.2.0-2+deb.sury.org~trusty+1 amd64 [installed]
php5-mysql/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 amd64 [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]
php5-readline/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 amd64 [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]
php5-sqlite/now 5.6.17+dfsg-1+deb.sury.org~trusty+1 amd64 [installed,upgradable to: 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1]

答案1

Ondrej Sury 曾一度更改其 PPA 中 PHP 软件包的命名约定;Trusty 的 PHP 5.6 软件包现在使用字符串php5.6代替php5。这就是为什么例如 软件包php5未升级的原因:较新的版本位于 软件包中php5.6,而 软件包是不同的。

因此,为了获取新版本,必须删除所有php5软件包并安装其对应版本。可以使用 获取php5.6当前安装的所有软件包的列表。php5apt list --installed | grep php5

相关内容