ubuntu16.04中安装php5:Package php5 is not available, but is referred to by another package.解决方案

本文解决了在Ubuntu 16.04环境下安装PHP5时遇到的问题,通过更改软件源并使用特定PPA来成功安装PHP5.5及其依赖。

ubuntu16.04中安装php5的时候,一直提示:Package php5 is not available, but is referred to by another package.

sudo apt-get update

后无法解决,更换源,再次sudo apt-get update还是同样的问题。

在知乎上看到binvec的答案。才真正解决。

sudo apt-get install -y language-pack-en-base 
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php 
sudo add-apt-repository ppa:ondrej/php 
sudo apt-get update 
apt-cache search php5 
sudo apt-get install php5.5-common 
sudo apt-get install libapache2-mod-php5.5

作者:binvec
链接:https://www.zhihu.com/question/45999546/answer/100165171
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
注意:根据版本的更新php的版本可能是5.6及以上的版本。



sudo apt-get install gcc g++ binutils patch bzip2 flex bison autoconf make gettext texinfo subversion libncurses5-dev unzip sharutils ncurses-term zlib1g-dev [sudo] password for brikin: Reading package lists... Done Building dependency tree Reading state information... Done Package ncurses-term 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 libncurses5-dev 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 autoconf 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 texinfo 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 However the following packages replace it: install-info info Package bison 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 flex 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 'flex' has no installation candidate E: Package 'bison' has no installation candidate E: Package 'autoconf' has no installation candidate E: Package 'texinfo' has no installation candidate E: Package 'libncurses5-dev' has no installation candidate E: Package 'ncurses-term' has no installation candidat什么情况
08-09
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值