php - Derby 安 9 : the php5 packages is not installed

标签 php linux debian

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

----------------------------------------------------------------------
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-dev 我收到错误 E: 无法定位包 php5-dev

但是,命令 sudo apt-get install php-dev成功

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

这是否意味着我安装了 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

最佳答案

打开终端并运行以下命令:

apt-get install apt-transport-https lsb-release ca-certificates

获取 gpg key :

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

安装PHP5.6

apt-get 更新 apt-get 安装 php5.6

更新

echo "deb https://packages.sury.org/php/$(lsb_release -sc) main">/etc/apt/sources.list.d/php.list 行的解决方法:

运行它,并记下输出:

lsb_release -sc

在您选择的编辑器中打开 /etc/apt/sources.list.d/php.list 并将其附加到底部:

deb https://packages.sury.org/php/OUTPUT_FROM_LSC_COMMAND main

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

相关文章:

Bash 脚本 : Turn on errors?

php - 时区特定的 "Open Now"函数

php mysql_insert_id() 可能与多用户冲突

javascript - 需要将 JSON 对象转换为 Highcharts 的 JSON 数组

linux - 如何以 unix 精神编码? (小型单任务工具)

mysql - 如何连续监控 mysql 数据库表中的新条目,并在发现新条目后立即使用 cron 作业触发批处理文件

python - 在 debian 上通过 crontab 执行 python 脚本真是太疯狂了!

php - 单行数据库的随机输出

c - Linux 上的最大主机名长度

linux - 如何在 Debian Wheezy 中编辑 GNOME3 配置