Home  >  Article  >  Backend Development  >  How to install php server environment

How to install php server environment

藏色散人
藏色散人Original
2020-07-24 09:09:172651browse

How to install the php server environment: first install apache and start it; then install mysql; then install php through the command "yum install php php-mysql"; and finally restart apache.

How to install php server environment

php server environment installation and project construction

Install the running environment and build the project

Installation apache and testing

1) Install apache

yum install httpd

Start apache

systemctl start httpd.service

View the running status

systemctl status httpd.service

2) Edit the test page

echo “xingming”>/var/www/html/index.html

3) Open the browser and enter the public IP address. The result is as follows

How to install php server environment

Install MySQL

1 ) Install mysql

yum install mariadb-server mariadb
systemctl start mariadb     //运行
systemctl status mariadb    //查看运行状态
# mysql -u root -p      //登录mysql
Enter password: 【输入原来的密码】   //密码默认为空
mysql>usemysql;

2) Change the password

mysql> update user setpassword=passworD("test") where user='root';
mysql> flush privileges;
mysql> exit;

3) Create a database through sql statements, create tables, and insert data

Install the php environment

Install php

yum install php php-mysql

Restart apache

systemctl restart httpd.service

Project upload

Transfer the developed project to On the server

How to install php server environment

Create and modify the permissions written by the "Project Name" permission

chmod -R 777 项目名

Run results

Recommended : "PHP Tutorial"

The above is the detailed content of How to install php server environment. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn