How to build a PHP environment on a CentOS7.0 system (LAMP:APACHE+PHP+MARIADB)

Source: Internet
Author: User
Bloggers today installed a centos,7.0 version of the natural to build PHP environment, the following to build the process of sharing to everyone.

First, install Apache

Input: Yum install httpd httpd-devel

In the process, just enter Y to confirm it.

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

Second, installation mariadb

In CentOS 7.0, the MySQL database has been replaced with MARIADB

1, installation mariadb

Yum Install mariadb mariadb-server #询问是否要安装, enter y for automatic installation until installation is complete

CP/USR/SHARE/MYSQL/MY-HUGE.CNF/ETC/MY.CNF #拷贝配置文件 (Note: If the/etc directory has a my.cnf under the default, you can directly overwrite it)

Systemctl Start Mariadb.service #启动MariaDB

Systemctl Stop Mariadb.service #停止MariaDB

Systemctl Restart Mariadb.service #重启MariaDB

Systemctl Enable Mariadb.service #设置开机启动

2. Set the password for the root account

Mysql_secure_installation

Enter, follow the prompts for Y

Enter Password 2 times, enter

Enter Y as prompted

Last appearance: Thanks for using mysql!

MySQL password setup is complete, restart MySQL:

Systemctl Restart Mariadb.service #重启MariaDB

Third, install PHP

1. Install PHP

Yum Install PHP php-devel #根据提示输入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

Iv. Testing

Cd/var/www/html

VI index.php #输入下面内容

Phpinfo ();

?>

: wq! #保存退出

In the client browser enter the server IP address, you can see the configuration information as shown in the relevant!

  • 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.