How to install php server environment

藏色散人
Release: 2023-03-03 07:48:01
Original
2664 people have browsed it

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
Copy after login

Start apache

systemctl start httpd.service
Copy after login

View the running status

systemctl status httpd.service
Copy after login

2) Edit the test page

echo “xingming”>/var/www/html/index.html
Copy after login

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;
Copy after login

2) Change the password

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

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

Install the php environment

Install php

yum install php php-mysql
Copy after login

Restart apache

systemctl restart httpd.service
Copy after login

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 项目名
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template