centos7环境配置

精帖 77
1、先更新软件包
sudo yum update -y
3、安装nginx
//添加源
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
//安装
sudo yum install -y nginx
启动Nginx并设置开机自动运行
sudo systemctl start nginx.service
sudo systemctl enable nginx.service


//php环境,选择性安装
//如果有安装的PHP包,先删除他们
sudo yum remove -y php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64
//配置yum源
sudo rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
//安装
sudo yum install -y --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

//用PHP命令查看版本。
php --version
2、安装docker
sudo yum install -y docker
//设置开机自启动
sudo systemctl enable docker
//立即启动
sudo systemctl start docker
参考文章https://www.cnblogs.com/flying1819/articles/9141131.html
回帖