如何在 Debian GNU/Linux 7 上将 PHP 5.4 升级到 PHP 5.6(wheezy)

如何在 Debian GNU/Linux 7 上将 PHP 5.4 升级到 PHP 5.6(wheezy)

我已将这些行添加到/etc/apt/sources.list

deb http://packages.dotdeb.org wheezy-php56 all
deb-src http://packages.dotdeb.org wheezy-php56 all

但仍然sudo apt-get update不要sudo apt-get upgrade触碰 php。

php --version还是

PHP 5.4.39-0+deb7u2 (cli) (built: Mar 25 2015 08:33:29) 

答案1

更新)尝试这个(Ubuntu):

sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
sudo apt-get install php5.6-fpm -y

(更新) 对于 Debian Wheezy (使用 sudo)

echo "deb http://packages.dotdeb.org wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list
echo "deb-src http://packages.dotdeb.org wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list
wget http://www.dotdeb.org/dotdeb.gpg -O- | apt-key add - 
apt-get update
apt-get install php5-cli php5-fpm ….. (or whatever package you might need)

(2017 年 6 月 21 日更新) 对于 Debian 8(jessie)

sudo nano /etc/apt/sources.list

添加以下存储库:

...
deb http://mirrors.digitalocean.com/debian jessie main contrib non-free
deb-src http://mirrors.digitalocean.com/debian jessie main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

# jessie-updates, previously known as 'volatile'
deb http://mirrors.digitalocean.com/debian jessie-updates main contrib non-free
deb-src http://mirrors.digitalocean.com/debian jessie-updates main contrib non-free

然后更新你的来源:

sudo apt-get update

然后安装 php5-fpm

sudo apt-get install php5-fpm

答案2

sudo nano /etc/apt/sources.list

添加

deb http://packages.dotdeb.org wheezy all
deb-src http://packages.dotdeb.org wheezy all
deb http://packages.dotdeb.org wheezy-php56-zts all
deb-src http://packages.dotdeb.org wheezy-php56-zts all

保存并运行

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5 

更多信息请点击此处 https://www.dotdeb.org/instructions/

答案3

完成后apt-get updateapt-get upgrade必须使用以下命令进行安装:

sudo apt-get install php5

相关内容