TL;DR
所以这里是你如何阅读中的问题:它没有概述它实际需要的特定版本中的每个包。所以它(可能)安装了正确的 PHP 版本,但不是正确的 cli 版本,而且肯定不是正确的 apache mod。
我设法构建了一个 apt-get 命令来安装正确的 apache 和 php 版本。因此,您有了一个基本的安装(没有那么多扩展和东西),您可以继续:
apt-get install php5=5.3.10-2 php5-cli=5.3.10-2 php5-common=5.3.10-2 \
libapache2-mod-php5=5.3.10-2 apache2=2.2.22-1 apache2.2-common=2.2.22-1 \
apache2-mpm-prefork=2.2.22-1 ssl-cert apache2.2-bin=2.2.22-1
我是如何到达那里的
我想在这里概述我是如何到达那里的文档目的:
我基本上是从 php5 和 php5-cli 包开始的,但遇到了很多类似这样的 apt-get 问题:
The following packages have unmet dependencies:
apache2-bin : Conflicts: apache2.2-common but 2.2.22-1 is to be installed
apache2.2-common : Depends: apache2.2-bin (= 2.2.22-1) but 2.4.7-1ubuntu4.13 is to be installed
libapache2-mod-php5 : Depends: apache2-mpm-prefork (> 2.0.52) but it is not going to be installed or
apache2-mpm-itk but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
最简单的方法是运行madison 以列出可用版本并选择正确的版本(在您的情况下,它可能永远是最旧的版本):
apt-cache madison apache2-mpm-prefork
apache2-mpm-prefork | 2.4.10-1ubuntu1.1~ubuntu14.04.1 | http://us.archive.ubuntu.com/ubuntu/ trusty-backports/main amd64 Packages
apache2-mpm-prefork | 2.4.7-1ubuntu4.13 | http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
apache2-mpm-prefork | 2.4.7-1ubuntu4.13 | http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
apache2-mpm-prefork | 2.4.7-1ubuntu4 | http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
apache2-mpm-prefork | 2.2.22-1 | http://snapshot.debian.org/archive/debian/20120221T041601Z/ unstable/main amd64 Packages
apache2 | 2.4.7-1ubuntu4 | http://us.archive.ubuntu.com/ubuntu/ trusty/main Sources
apache2 | 2.4.7-1ubuntu4.13 | http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main Sources
apache2 | 2.4.10-1ubuntu1.1~ubuntu14.04.1 | http://us.archive.ubuntu.com/ubuntu/ trusty-backports/main Sources
apache2 | 2.4.7-1ubuntu4.13 | http://security.ubuntu.com/ubuntu/ trusty-security/main Sources
apache2 | 2.2.22-1 | http://snapshot.debian.org/archive/debian/20120221T041601Z/ unstable/main Sources
顺便提一下,这是要安装的 Apache 2.2。我不知道它的支持程度如何,但我确信 PHP 5.3 已经过时了。您可能会面临相当大的安全问题。