首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >Centos7 安装最新版 NGINX,PHP,Mysql,Mariadb

Centos7 安装最新版 NGINX,PHP,Mysql,Mariadb

作者头像
老高的技术博客
发布于 2022-12-28 12:15:04
发布于 2022-12-28 12:15:04
1K0
举报

自己下载源代码编译很麻烦有没有?注意系统是Centos7!

NGINX

代码语言:javascript
复制
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install -y nginx

systemctl start nginx
systemctl status nginx
systemctl enable nginx

PHP

代码语言:javascript
复制
yum install -y yum-utils wget


wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm

# 激活remi
yum-config-manager --enable remi-php72

yum install -y \
php \
php-devel \
php-json \
php-mysqlnd \
php-fpm \
php-gd \
php-mbstring \
php-pdo \
php-pecl-swoole \
php-pgsql \
php-mcrypt \
php-soap \
php-pecl-redis \
php-pecl-memcache \
php-pecl-memcached \
php-pecl-xdebug


systemctl start php-fpm
systemctl status php-fpm
systemctl enable php-fpm

Mariadb

5.X

代码语言:javascript
复制
# 如果先安装的10版本,需要执行 yum downgrade

vi /etc/yum.repos.d/MariaDB.repo
# add

# MariaDB 5.5 CentOS repository list - created 2017-03-01 02:14 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

yum install MariaDB-server MariaDB-client

10.1

代码语言:javascript
复制
vi /etc/yum.repos.d/MariaDB.repo
# add
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1


yum install -y MariaDB-server MariaDB-client

systemctl start mariadb
systemctl status mariadb
systemctl enable mariadb

Mysql

代码语言:javascript
复制
yum localinstall -y https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

yum install -y mysql-community-server


systemctl start mysqld
systemctl status mysqld
systemctl enable mysqld

Reference:

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017-02-24,如有侵权请联系 cloudcommunity@tencent.com 删除
目录
  • NGINX
  • PHP
  • Mariadb
    • 5.X
    • 10.1
  • Mysql
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档