Home > Backend Development > PHP Problem > How to install php server

How to install php server

王林
Release: 2023-02-26 19:28:01
Original
2384 people have browsed it

How to install php server

Install apache

yum install httpd
Copy after login

Start apache

systemctl start httpd.service
Copy after login

View running status

systemctl status httpd.service
Copy after login

Edit test page

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

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

How to install php server

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

Change password

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

Install php Environment

yum install php php-mysql
Copy after login

Restart apache

systemctl restart httpd.service
Copy after login

Recommended tutorial: PHP video tutorial

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

Related labels:
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