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