Home >Backend Development >PHP Problem >How to install php server
Install apache
yum install httpd
Start apache
systemctl start httpd.service
View running status
systemctl status httpd.service
Edit test page
echo “xingming”>/var/www/html/index.html
Open the browser and enter the public IP address. The result is as follows:
Install MySQL
yum install mariadb-server mariadb systemctl start mariadb //运行 systemctl status mariadb //查看运行状态 # mysql -u root -p //登录mysql Enter password: 【输入原来的密码】 //密码默认为空 mysql>usemysql;
Change password
mysql> update user setpassword=passworD("test") where user='root'; mysql> flush privileges; mysql> exit;
Install php Environment
yum install php php-mysql
Restart apache
systemctl restart httpd.service
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!