PHP的搭建

版权声明:此文章最终版权归HrainOne所有,欢迎转载,转载请声明最终版权 https://blog.csdn.net/gaoxin_gx/article/details/89490389
服务器与域名的知识点请看:

https://www.cnblogs.com/Hrain/p/10493612.html

新手或许会遇到这个问题:在没有搭PHP环境时,若将PHP网站上传到了var/www/html中,是不能访问的。若网站是纯静态的HTML,直接放到var/www/html目录下,可以直接访问。

我的服务器是centos的,搭建过程:

1:  Linux下,输入账号和密码,登录linux系统

2:  安装Apache,并启动:

yum install httpd  (启动)systemctl start httpd.service  { (重启)systemctl restart httpd.service  (停止)systemctl stop httpd.service }

3:  关闭防火墙

systemctl stop firewalld.service

4:  安装PHP

yum -y install php

5:  安装php的各项服务

yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel php-mysql

6:  安装MariaDB数据库(centos7.0中替代MySQL数据库,原因:MySQL被Oracle收购)

yum -y install mariadb-server mariadb-client

7:  启动

systemctl start mariadb.service

猜你喜欢

转载自blog.csdn.net/gaoxin_gx/article/details/89490389