无法在Raspbian上安装php 7.2

时间:2017-12-05 09:20:42

标签: php debian raspbian

我无法在Raspbian上安装php 7.2。 我使用最后一个Raspbian(发布日期:2017-11-29)和Debian Stretch 9.1:https://www.raspberrypi.org/downloads/raspbian/

我按照https://www.colinodell.com/blog/2016-12/installing-php-7-1

的说明操作
apt-get install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt-get update

但是当我尝试

apt-get install -y php7.2

A得到以下错误:

root@raspberrypi:/home/pi# apt-get install -y php7.2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.2 : Depends: libapache2-mod-php7.2 but it is not installable or
               php7.2-fpm but it is not installable or
               php7.2-cgi but it is not installable
      Depends: php7.2-common but it is not installable
E: Unable to correct problems, you have held broken packages.
有人可以帮帮我吗? 非常感谢

3 个答案:

答案 0 :(得分:2)

我找到了原因,包裹php7.1和php7.2并不是在弹性回购中:(。

https://raspberrypi.stackexchange.com/questions/70388/how-to-install-php-7-1

必须等待更新...

答案 1 :(得分:1)

请检查此GitHub问题: https://github.com/oerdnj/deb.sury.org/issues/579

似乎尚未针对ARM体系结构发布针对较新PHP版本的Debian软件包。 我想为构建这样的软件包做出贡献,但在我上一篇文章之后没有关于这个问题的活动。

安装PHP7.1或更新版本的选项是自行编译和安装。对于某些示例,您可能需要检查http://yoestuve.es/blog/compile-php-7-for-raspberry-pi-with-memcached/。我还建议您使用checkinstall代替make install,以便日后更轻松地进行卸载。

答案 2 :(得分:0)

不幸的是,对于具有拉伸能力的树莓,它看起来似乎不会比PHP 7.0更高。在这里,您可以看到当前和将来的raspbian版本的PHP版本: https://packages.debian.org/search?arch=armhf&searchon=names&keywords=php

您将必须升级到buster,然后才能获得PHP 7.3。方法如下: https://www.raspberrypi.org/blog/buster-the-new-version-of-raspbian/