我需要安装一些软件包来为在 VB 中运行的 Debian 9 OS 中的项目准备工作区。我有指令:

----------------------------------------------------------------------
The following Debian 8 packages are required to run [X-Product]:

sudo apt-get install exim4 ntp pwgen curl php5-dev php-pear pkg-config nmap libzmq3 libzmq3-dev libapache2-mod-php5 apache2 percona-server-server-5.6 php5-cli php5-mysql php5-curl php5-intl daemontools-run oracle-java8-installer ant ruby-compass libtool-bin
----------------------------------------------------------------------

当我运行命令时,我得到以下终端堆栈,
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php5-cli 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-mysql 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-curl 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 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

E: Unable to locate package php5-dev
E: Unable to locate package libzmq3
E: Package 'libapache2-mod-php5' has no installation candidate
E: Package 'php5-cli' has no installation candidate
E: Package 'php5-mysql' has no installation candidate
E: Package 'php5-curl' has no installation candidate
E: Unable to locate package php5-intl

我在互联网上做了一些研究,接下来做了以下工作,
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

它根本没有帮助我。我需要什么来解决这个问题?如果你问的话,我对 Debian 知之甚少

注意:我按照提供的答案中的说明进行操作,问题仍未解决,因为我看不到 php version
当我运行命令时sudo apt-get install php5.6
它打印在终端中,
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'php5.6-json' for regex 'php5.6'
Note, selecting 'php5.6-common' for regex 'php5.6'
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

要查找 PHP 版本,
sudo php -v

它打印在终端中,
sudo: php: command not found

更多信息,比如我运行它
sudo apt-get install php5-devI get errorE: Unable to locate package php5-dev
但是,命令sudo apt-get install php-dev 成功

命令dpkg -l | grep php| awk '{print $2}' |tr "\n" " " 返回值,

这是否意味着我安装了 hvae php7 并且阻止了其他操作?
dh-php php-cli php-common php-dev php-gd php-pear php-xml php7.0-cli php7.0-common php7.0-dev php7.0-gd php7.0-json php7.0-opcache php7.0-readline php7.0-xml pkg-php-tools

最佳答案

libapache2-mod-php5.6 php5-dev php5-mysql php5-curl 包只能安装在 debian Wheezy (7) 、 Jessie (8) 或 Sid 上。此外,ondrej/php 存储库不为 debian Stretch 提供这些包,它只提供 php5.6 包。

命令 sudo apt-get install php-dev 将安装 development module for PHP7 :

dh-php libssl-dev libssl-doc php7.1-cli php7.1-common php7.1-dev php7.1-json
php7.1-opcache php7.1-readline pkg-php-tools shtool xml2

关于php - Debian 9 : the php5 packages is not installed,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47691057/

10-13 06:44