当我尝试使用以下代码在Ubuntu16.04中安装php5时:
sudo apt-get install php5 php5-mcrypt
我得到以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 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: Package 'php5' has no installation candidate
我已经尝试重新安装,但没有帮助。
在我将我的15.10 Ubuntu更新到16.04之后,遇到了所有这些错误
发布于 2016-05-06 11:33:56
您必须使用前缀"php5.6-“,而不是ubuntu 14.04和olders中的"php5-”:
sudo apt-get install php5.6 php5.6-mcrypt
发布于 2016-05-20 01:09:06
如果你只想安装PHP而不管它是什么版本,可以试试PHP7。
sudo apt-get install php7.0 php7.0-mcrypt
发布于 2017-05-05 09:46:21
sudo apt-get install php7.0-mysql
,因为php7.0对我来说很好用。
https://stackoverflow.com/questions/36788873
复制相似问题