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

NGINX

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

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

# 如果先安装的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

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

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:

标签: PHP, mysql, nginx, mariaDB

已有 3 条评论

  1. 假肢 假肢

    老高你好,我按照你教的方法在安装mysql的时候,会报mysql与MariaDB存在冲突。
    例如:file /usr/share/mysql/charsets/Index.xml from install of mysql-community-common-5.6.35-2.el7.x86_64 conflicts with file from package MariaDB-common-10.1.21-1.el7.centos.x86_64
    请问这个问题应该怎么解决?

    1. 装Mariadb5.5就行,现在PHP的MYSQL库用的是Mariadb

      1. 假肢 假肢

        我刚刚把Mariadb卸载了,现在把mysql装上了哈

添加新评论