1.安装Apache

yum -y install httpd 

用/etc/init.d/httpd start 启动apache

apache默认的程序目录是/var/www/html

2.安装MySQL

yum -y install mysql mysql-server

用/etc/init.d/mysqld start 启动mysql

mysql_secure_installation 按回车提示设置mysql密码,直到显示“Thanks for using MySQL!”

3.安装PHP

yum -y install php 

4.启动设置

service httpd start

service mysqld start

配置httpd、mysqld开机自启动

chkconfig mysqld on 
chkconfig httpd on

5.测试

在/var/www/html/新建test.php

<?php
phpinfo();
?>

访问:localhost/test.php,显示正常则LAMP环境安装成功

============================================

6.为了便于从web上去管理MySQL,安装phpMyAdmin

yum -y install phpMyAdmin

配置phpMyAdmin

修改/etc/phpMyAdmin/config.inc.php

$cfg['Servers'][$i]['controluser']   = 'root';          // MySQL control user settings
// (this user must have read-only
$cfg['Servers'][$i]['controlpass'] = 'xxxxxx'; // access to the "mysql/user"
.....
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = 'xxxxxx'; // MySQL password (only needed

将phpMyAdmin的安装路径连接到httpd服务目录下

ln -s /usr/share/phpMyAdmin /var/www/phpMyAdmin

修改/etc/httpd/conf.d/phpMyAdmin.conf,把"Deny from All" 修改为"Allow from All"

<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF- <IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Allow from All
Allow from 127.0.0.1
Allow from ::
</IfModule>
</Directory>

在浏览器地址栏中打开http://localhost/phpmyadmin

到此,phpmyadmin配置安装成功!

搭建PHP环境LAMP(Linux+Apache+MySQL+PHP)的更多相关文章

  1. Lamp(linux+apache+mysql+php)环境搭建

    Lamp(linux+apache+mysql+php)环境搭建 .安装apache2:sudo apt-get installapache2 安装完毕后.执行例如以下命令重新启动apache:sud ...

  2. CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境【转载】

    本文转载自 园友David_Tang的博客,如有侵权请联系本人及时删除,原文地址: http://www.cnblogs.com/mchina/archive/2012/11/28/2778779.h ...

  3. Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)

    Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)   关于LAMP的各种知识,还请大家自行百度谷歌,在这里就不详细的介绍了,今天主要是介绍一下在Centos下安装,搭建一 ...

  4. CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境

    一.简介 什么是LAMP    LAMP是一种Web网络应用和开发环境,是Linux, Apache, MySQL, Php/Perl的缩写,每一个字母代表了一个组件,每个组件就其本身而言都是在它所代 ...

  5. CentOS 6.3 源码安装LAMP(Linux+Apache+Mysql+Php)环境

    一.简介 什么是LAMP LAMP是一种Web网络应用和开发环境,是Linux, Apache, MySQL, Php/Perl的缩写,每一个字母代表了一个组件,每个组件就其本身而>言都是在它所 ...

  6. CentOS6系统编译部署LAMP(Linux, Apache, MySQL, PHP)环境

    我们一般常规的在Linux服务器中配置WEB系统会用到哪种WEB引擎呢?Apache还是比较常用的引擎之一.所以,我们在服务器中配置LAMP(Linux, Apache, MySQL, PHP)是我们 ...

  7. Ubuntu在下面LAMP(Linux+Apache+MySQL+PHP) 开发环境的搭建

    LAMP在行业是一个非常流行的词.此4字母代表Linux.Apache,MySQL和PHP. LAMP其高效.灵活的特点已经成为中小企业的首选. 它已经推出了快速构建LAMP道路. 1 在Ubuntu ...

  8. 【转】CentOS环境下yum安装LAMP(Linux+Apache+Mysql+php)

    此种方法很简单.每次都用源码编译,浪费好多时间啊! 同样的网站程序在Linux下运行要比在windows下快出不少,所以决定使用Linux的发行版CentOS ,本文主要讲解在CentOS下使用yum ...

  9. CentOS 6.5下源码安装LAMP(Linux+Apache+Mysql+Php)环境

    ---恢复内容开始--- 一.系统环境 系统平台:CentOS 6.5 (Final) Apache版本:httpd-2.2.31.tar.gz(最新版本2015-07-16) Mysql 版本:my ...

随机推荐

  1. BZOJ3448 : [Usaco2014 Feb]Auto-complete

    RE了几十发,实在没办法了…只好向管理员要数据,然后发现数据规模与题目描述不符… 建立Trie并求出DFS序,同时根据DFS序确定字典序 然后每次询问相当于询问子树第k小,用主席树维护,注意压缩内存 ...

  2. 常用元素默认margin和padding值问题探讨

    关于默认元素在不同浏览器中的margin值是多少的问题,今天做了一个探讨 复制代码 代码如下: // body的margin值 firefox 20.0 ----------------------- ...

  3. 一人一python挑战题解

    题目id: 1 just print a+b give you two var a and b, print the value of a+b, just do it!! print a+b 题目id ...

  4. Qt Creator 快捷键

    Qt Creator 你必须要掌握的快捷操作 http://jingyan.baidu.com/article/6fb756ecab5158241858fbb0.html 多使用快捷键能显著提高工作效 ...

  5. 模板引擎freemarker的简单使用教程

    freemarker十分强大,而且不依赖web容器,个人感觉十分好用. 下面直接进主题,freemarker还有什么特性,请找度娘或谷哥~ 一.freemarker生成word 1.创建模板. 我创建 ...

  6. 初识python面向对象

    一.初识python面向对象: class Person: #使用class关键字定义一个类 age=0 #类变量(静态变量) def eat(self,food): #定义一个方法 self.age ...

  7. easyui datagrid 列显示和隐藏

    //当查询IT基础设施的时候隐藏'STAFF_ID'.'ITSM_STAFF_ID' if($("input[name='currentstate']").val()==2){ $ ...

  8. IOS第六天(1:scrollView 属性和查看大图)

    ***查看大图 #import "HMViewController.h" @interface HMViewController () <UIScrollViewDelega ...

  9. OpenCV学习笔记——图像的腐蚀与膨胀

    顺便又复习了一下cvcopy如何进行图像拼接(最近觉得打开多幅图像分别看不如缩小掉放拼接到一幅图像上对比来的好) 首先把拼接的目标图像设置兴趣区域ROI,比如我有一个total,要把a.b.c分别从左 ...

  10. CSS3:背景

    细节注意 盒子:border-box | padding-box | content-box用于background-origin背景的开始和background-clip的剪切位置. 渐变也是生成一 ...