首页 >后端开发 >PHP问题 > 正文

ubuntu 安装不了php5怎么办

原创2021-03-31 09:52:4901020

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中文网其它相关文章!

php中文网最新课程二维码

声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理

  • 相关标签:ubuntu
  • 相关文章

    相关视频


    网友评论

    文明上网理性发言,请遵守 新闻评论服务协议

    我要评论
  • 专题推荐

    推荐视频教程
  • PHP8新特性初体验(公益直播课)PHP8新特性初体验(公益直播课)
  • PHP开发基础之字符串篇PHP开发基础之字符串篇
  • PHP开发基础之类与对象篇PHP开发基础之类与对象篇
  • PHP开发基础之数据库篇(PDO)PHP开发基础之数据库篇(PDO)
  • php8,我来也php8,我来也
  • 视频教程分类