Centos7 use the yum command to install the LAMP environment (php + Apache + Mysql) and php extension, centos7yum

Source: Internet
Author: User
Tags install redis

Centos7 use the yum command to install the LAMP environment (php + Apache + Mysql) and php extension, centos7yum

1. yum-y update // update the system

 

2. Install mysql

(2.1) yum-y install mariadb-client mariadb-server mariadb-devel

2.2) start: systemctl start mariadb. service

2.3) set the automatic start: systemctl enable mariadb

2.4) set the root password: mysqladmin-u root password "123456"

2.5) set root Remote Access: log on to mysql => use mysql; => update user set host = '%' where user = 'root' and host = 'localhost '; => flush privileges; => exit; => systemctl restart mariadb. service

 

3. install apache

(3.1) yum-y install httpd

3.2) start: systemctl start httpd. service

3.3) set the automatic start: systemctl enable httpd

 

4. Install php7

4.1) Please refer to https://webtatic.com/packages/php70/

4.2) rpm-Uvh https://Dl.fedoraproject.org/Pub/Epel/Epel-release-latest-7.noarch.rpm

4.3) rpm-Uvh https://Pai.webtatic.com/Yum/El7/Webtatic-release.rpm 

4.4) yum-y install php70w php70w-opcache php70w-common php70w-fpm php70w-mbstring

4.5) after installing php, restart httpd and systemctl restart httpd.

 

5. Install phpredis Extension

(5.1) yum-y install redis php-redis

5.2) restart httpd and systemctl restart httpd

 

6. Deployment successful

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.