前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Centos系统下Lamp环境的快速搭建

Centos系统下Lamp环境的快速搭建

作者头像
庞小明
发布2018-03-07 17:02:52
1.3K0
发布2018-03-07 17:02:52
举报
文章被收录于专栏:pangguomingpangguoming

首先为了搭建一个稳定的lamp的练习环境,确保你的虚拟机可以连网,这里我们使用的yum安装,它可以帮助我们解决软件自己的依赖关系.我还在后面加了postgresql数据库如果不需要的话可以去掉和postgresql的参数.命令如下 yum -y install httpd mysql mysql-server php php-mysql postgresql postgresql-server php-postgresql php-pgsql php-devel

Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)

yum安装过程,大概1-2分钟

Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)

启动apache服务并查看时候启动成功 命令如下:(切记用root用户启动服务)            启动:httpd start            检测启动结果:ps aux | grep httpd

Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)

查看服务器的ip并进入网站根目录新建一个phpinfo.php的程序,用于查看php相关配置信息。

Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)

如果上述进展顺利,那我们接下来进行mysql数据库的配置 命令如下:              启动:  /etc/rc.d/init.d/mysqld start              检查启动结果:  netstat -tulnp | grep :3306               修改root密码: mysqladmin -u root password ‘你想设置的密码’

Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)

进入mysql数据库,创建demo库和用于测试的person表,并插入测试数据

Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)

最后编写php连接mysql的测试代码,检测mysql是否能正常配合php工作

Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
Centos系统下Lamp环境的快速搭建(超详细)
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2016-12-21 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档