美文网首页
Docker CentOS镜像安装php7

Docker CentOS镜像安装php7

作者: HueyYao | 来源:发表于2020-12-06 11:51 被阅读0次

    ①安装docker并配置完docker加速后

    依次输入以下:

    docker pull centos:centos7
    docker images
    docker run -t -i centos:centos7 /bin/bash 
    

    ②在进入CentOs7之后先安装wget

    yum -y install wget
    

    ③然后解决CentOs yum解决下载速度慢 更换下载源

    cd /etc/yum.repos.d/
    mv CentOS-Base.repo CentOS-Base.repo.back   /*备份或者改名*/
    wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 
    yum makecache /*生成缓存*/
    

    ④处理wget下载速度过慢

    wget http://jaist.dl.sourceforge.net/project/kmphpfm/mwget/0.1/mwget_0.1.0.orig.tar.bz2
    yum install bzip2 gcc-c++ openssl-devel intltool -y
    bzip2 -d mwget_0.1.0.orig.tar.bz2
    tar -xvf mwget_0.1.0.orig.tar 
    cd mwget_0.1.0.orig
    ./configure 
    make
    make install  
    

    ⑤下载安装php环境

    yum install epel-release
    yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
    systemctl enable php-fpm.service
    systemctl start php-fpm.service
    yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel 
    

    最后执行

    php -v
    

    相关文章

      网友评论

          本文标题:Docker CentOS镜像安装php7

          本文链接:https://www.haomeiwen.com/subject/izrowktx.html