[英]Debian 9: the php5 packages is not installed
我需要安裝一些軟件包來為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 I get error E: Unable to locate package php5-dev
但是,命令sudo apt-get install php-dev
是成功的
命令dpkg -l | grep php| awk '{print $2}' |tr "\\n" " "
dpkg -l | grep php| awk '{print $2}' |tr "\\n" " "
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密鑰:
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 update apt-get install php5.6
更新
line 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
包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
將安裝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
Debian 9不包含PHP 5.x(參見https://wiki.debian.org/PHP )。 要從ppa安裝它,安裝包php5.6
並相應地命名其他包(如libapache2-mod-php5.6
而不是libapache2-mod-php5
)
我有同樣的問題,試圖按照php的網站上的說明。
事實證明,在Debian 9上,它非常簡單:只需從包名中刪除版本即可。
# apt-get install php-common libapache2-mod-php php-cli Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libapache2-mod-php7.0 php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-readline Suggested packages: php-pear The following NEW packages will be installed: libapache2-mod-php libapache2-mod-php7.0 php-cli php-common php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-readline
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.