开发者社区> 问答> 正文

请问阿里云默认centos7上怎么安装php啊?

我用以下命令安装,一直报错,请问如何解决?谢谢啦。

[root@ixxxx opt]# yum install php54 php54-mysql php54-common php54-gd php54-mbstring php54-mcrypt php54-devel
Loaded plugins: langpacks
Could not retrieve mirrorlist htt://mirrors.iuscommunity.org/mirrorlist?repo=ius-centos6&arch=x86_64&protocol=http error was
14: curl#7 - "Failed to connect to 2001:4802:7901:0:4ccc:ff11:0:4: Network is unreachable"




One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:


     1. Contact the upstream for the repository and get them to fix the problem.


     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).


     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:


            yum-config-manager --disable <repoid>


     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:


            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true


Cannot find a valid baseurl for repo: ius/x86_64

展开
收起
雾隐 2015-11-03 14:34:15 13359 0
4 条回答
写回答
取消 提交回答
  • htt://mirrors.iuscommunity.org 这个无法访问,可以换成163的。镜像地址163的是 http://mirrors.163.com
    2015-11-07 21:24:22
    赞同 展开评论 打赏
  • 回 3楼(kideny) 的帖子
    centos 7怎么了
    debian就比centos强吗?
    同样的核心,基本什么什么差异
    关键在于包源,centos的包源自Redhat,debian是debian社区自源的,Redhat和debian社区,谁的技术实力更强,linux老鸟都明白,不用我多做解释。




    还有楼主的命令明显就是错误的 yum安装centos 7源里的 php是不需要版本号的,比如 yum install php 。。。。不需要带54这样的版本号,源里有什么版本默认就安装最新版


    如果楼主使用第3方开发者源,源里有多个PHP版本,yum的时候才需要版本号来选择版本



    2015-11-07 19:51:36
    赞同 展开评论 打赏
  • PHP程序员,业余无线电爱好者,呼号:BH9BHT,自由职业!
    回 楼主(雾隐) 的帖子
    换国内的镜像站试试,或者装lnmp环境,可以选择php版本
    2015-11-04 15:53:45
    赞同 展开评论 打赏
  • Network is unreachable

    镜像地址网络不通。 建议换一个源
    2015-11-03 15:11:58
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
PHP安全开发:从白帽角度做安全 立即下载
PHP 2017.北京 全球开发者大会——高可用的PHP 立即下载
复杂PHP系统性能瓶颈排查及优化 立即下载