ubuntu安裝不了php5是因為ubuntu16.04官方軟體庫中沒有php5,只自備php7,其解決方法就是安裝14.04或使用PPA即可。
本文操作環境:ubuntu16.04系統、PHP5版,DELL G3電腦
在ubuntu16.04下無法安裝php5問題解決
由於先前的專案是用php5寫的,想要部署在升級到ubuntu16.04的系統上就要安裝php5版本,執行下列指令後發現如下提示:
lhs@taing:/var/www/html$ sudo apt-get install php5 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 lhs@taing:/var/www/html$ sudo apt-get install libapache2-mod-php5 Reading package lists... Done Building dependency tree... 50% Building dependency tree Reading state information... Done 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: Package 'libapache2-mod-php5' has no installation candidate
造成這種錯誤提示的原因是16.04官方軟體庫中沒有php5,只自備php7。想要安裝php5的話,需要安裝14.04或使用PPA。
【推薦學習:PHP影片教學】
#以上是ubuntu 安裝不了php5怎麼辦的詳細內容。更多資訊請關注PHP中文網其他相關文章!