Centos 7 Installation Lamp Environment

Source: Internet
Author: User

First, the installation of CentOS
   Download CentOS 7 and install it after burning to CD
Second, install Apache

Yum Install httpd #根据提示, enter Y to install successfully

Systemctl Start Httpd.service #启动apache

Systemctl Stop Httpd.service #停止apache

Systemctl Restart Httpd.service #重启apache

Systemctl Enable Httpd.service #设置apache开机启动

To open the server IP address in the client browser, the following interface appears, indicating that Apache installation was successful

Third, install MySQL
1. Download the MySQL repo source


$ wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

2. Install the MYSQL-COMMUNITY-RELEASE-EL7-5.NOARCH.RPM package
$ sudo rpm-ivh mysql-community-release-el7-5.noarch.rpm

After installing this package, you will get two MySQL yum repo Source:/etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo.
3. Install MySQL
$ sudo yum install MySQL
$ sudo yum install Mysql-server
4. You can also install mariadb instead of MySQL
$ sudo yum install MariaDB
$ sudo yum install Mariadb-server
Iv. Installation of PHP

1. Install PHP

Yum Install PHP #根据提示输入Y直到安装完成

2, install PHP components, so that PHP support MariaDB

Yum install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath Php-mhash

#这里选择以上安装包进行安装, enter Y return as prompted

Systemctl Restart Mariadb.service #重启MariaDB

Systemctl Restart Httpd.service #重启apache

3. Test PHP

$CD/var/www/html

$vi index.php #输入下面内容 (press the INSERT key)

<?php

Phpinfo ();

?>

#输入下面内容 (Press the ESC key to return to command-line mode)

: wq! #保存退出

Centos 7 Installation Lamp Environment

Related Article

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.