IDC知识库
IDC领域专业知识百科平台

linux服务器php环境

linux服务器php环境用的比较多的就是lamp环境,也就是linux+apache+mysql+php环境。以下就是介绍配置方法。

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就可以了。

对于一些新手来说,linux系统基本全靠命令行操作,还是有些困难的,我们也可以使用一些Linux管理面板来操作,如WDCP及宝塔面板等都能快速搭建php的运行环境。
鏈嶅姟鍣ㄤ唬缁�
域名频道为客户提供服务器代维服务,为客户节约服务器维护成本,费用不到专职人员的十分之一。
因此用户自己购买服务器后,将其放置到IDC机房中运行。而提供这一互联网服务则成为服务器托管
华东最有实力IDC服务商十强,服务器托管和维护的专业公司-域名频道提供极具性价比的服务器托管和租用服务。
越来越多的公司选择使用域名频道服务器租用和托管服务,购买链接http://www.dns110.com/server/

赞(1)
分享到: 更多 (0)

中国专业的网站域名及网站空间提供商

买域名买空间