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!