简体   繁体   English

无法在Raspbian上安装php 7.2

[英]Cannot install php 7.2 on Raspbian

I cannot install php 7.2 on Raspbian. 我无法在Raspbian上安装php 7.2。 I used the last Raspbian (Release date : 2017-11-29) with a Debian Stretch 9.1 : https://www.raspberrypi.org/downloads/raspbian/ 我使用了最后一个Raspbian(发布日期:2017-11-29)和Debian Stretch 9.1: https ://www.raspberrypi.org/downloads/raspbian/

I followed the instructions from https://www.colinodell.com/blog/2016-12/installing-php-7-1 : 我遵循了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

But when I try 但是当我尝试

apt-get install -y php7.2

A get the below errors : 得到以下错误:

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.

Someone can help me ? 有人可以帮助我吗? Thanks a lot 非常感谢

I found the reason, the package php7.1 and php7.2 isn't in the stretch repo :(. 我发现了原因,软件包php7.1和php7.2不在拉伸仓库中:(。

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

Have to wait an update ... 必须等待更新...

Please check this GitHub issue: https://github.com/oerdnj/deb.sury.org/issues/579 请检查以下GitHub问题: https : //github.com/oerdnj/deb.sury.org/issues/579

It seems that Debian packages for newer PHP versions are not yet released for the ARM architecture. 似乎尚未针对ARM体系结构发布用于PHP新版本的Debian软件包。 I would like to contribute for building such packages, but there is no activity on the issue after my last post. 我想为构建这样的软件包做贡献,但是上一篇文章之后没有关于此问题的任何活动。

An option to install PHP7.1 or newer would be to compile and install it yourself. 安装PHP7.1或更高版本的选择是自己编译并安装。 For some examples, you may want to check http://yoestuve.es/blog/compile-php-7-for-raspberry-pi-with-memcached/ . 对于某些示例,您可能需要检查http://yoestuve.es/blog/compile-php-7-for-raspberry-pi-with-memcached/ I would also suggest to use checkinstall instead of make install in order to facilitate easier uninstallation later. 我也建议使用checkinstall而不是make install ,以方便以后的卸载。

Unfortunately it does not look like there will be a higher version than PHP 7.0 for raspberrys with stretch. 不幸的是,对于带有拉伸功能的树莓,它看起来似乎没有比PHP 7.0更高的版本。 Here you can see the PHP versions for current and future raspbian releases: https://packages.debian.org/search?arch=armhf&searchon=names&keywords=php 在这里,您可以看到当前和将来的raspbian版本的PHP版本: https ://packages.debian.org/search ? arch = armhf & searchon = names & keywords = php

You will have to upgrade to buster, then you will get PHP 7.3. 您将必须升级到buster,然后才能获得PHP 7.3。 Here is how: https://www.raspberrypi.org/blog/buster-the-new-version-of-raspbian/ 这是如何的: https//www.raspberrypi.org/blog/buster-the-new-version-of-raspbian/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM