PHP 无法在 Apache ARM 上运行

PHP 无法在 Apache ARM 上运行

我已经在 Beaglebone black 上安装了 ubuntu。

  apache2 -v
  Server version: Apache/2.4.18 (Ubuntu)
  Server built:   2016-04-15T18:00:57

  php -v
  PHP 7.0.4-7ubuntu2 (cli) ( NTS )
  Copyright (c) 1997-2016 The PHP Group
  Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
  with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

我看到这是 CLI 版本,所以我猜它不用于 HTTP?

根据博客文章,它说要安装 php5,但是当我尝试安装时,出现“没有安装候选项”的提示,但是当我获得一个 php 版本时,我猜这没关系?

我已经通过添加了 PPAsudo add-apt-repository ppa:ondrej/php并尝试安装 PHP5

sudo apt-get install php5 libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libapache2-mod-php5 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

Package php5 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 'php5' has no installation candidate
E: Package 'libapache2-mod-php5' has no installation candidate

我创建了一个名为 info.php 的文件并添加了以下行,但当我运行它时,它会打印<?php phpinfo() ?>在屏幕上(也尝试过短标签)。该文件位于/var/www/html

答案1

虽然sudo apt-get install php5失败了sudo apt-get install php5.6,但是 php 现在可以正常工作了。

相关内容