linux配置PHP环境!!(云服务器架设)

首先去阿里云或腾讯云购买主机(腾讯云现在有免费30天的云主机...)

 

购买好之后选择安装:

 

点登陆 就可以到linux的操作界面了

 进入操作界面

输入root账号密码取得权限之后就可以开始配置环境了

 

Apache安装
yum install httpd
启动
systemctl start httpd.service #启动
systemctl stop httpd.service #停止
systemctl restart httpd.service #重启
第二、设置开机启动/关闭
systemctl enable httpd.service #开机启动
systemctl disable httpd.service #开机不启动
第三、检查httpd状态
systemctl status httpd.service

 

关闭防火墙
关闭:systemctl stop firewalld.service
查看状态:systemctl status firewalld.service

 

PHP安装
yum -y install php

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

 

安装MariaDB数据库
CentOS 7.0中,已经使用MariaDB替代了MySQL数据库,原因你懂的,MYSQL被Oracle收购以后,前景堪忧,所以MYSQL兄弟MariaDB就出来了,继续开源事业。
安装:yum -y install mariadb-server mariadb-client
启动:systemctl start mariadb.service
停止:systemctl stop mariadb.service
查看状态:systemctl status mariadb.service
开机启动:systemctl enable mariadb.service
重启:systemctl restart mariadb.service

 

网站文件夹:
/var/www/html

然后把你的PHP文件上传到html文件夹里去浏览器中输入主机IP就可以了

 

 

还有个比较简单的方法就是用WDCP云主机服务器管理系统,这个系统集成了PHP的运行环境非常方便。

 

这个是下载地址:http://www.wdlinux.cn/bbs/thread-57643-1-1.html   

 

安装好了之后输入ip地址+端口8080就可以进入操作界面了。

 

嗯OK了登陆进去按照你的需要去上传网页配置数据库就好了。

 

posted @ 2017-05-11 21:00  小太白  阅读(27091)  评论(2编辑  收藏  举报