在Ubuntu 16.04 中默认无法安装php5,只能安装php7,直接用如下命令
1 |
sudo apt-get install php5-mysql |
会提示
1 2 3 4 5 |
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 E: Package 'php5-mysql' has no installation candidate |
按照这个文章中给出的解决方法,执行以下指令
1 2 3 |
sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "` sudo add-apt-repository ppa:ondrej/php sudo apt-get update |