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

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

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

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

    启动apache服务并查看时候启动成功

    命令如下:(切记用root用户启动服务)

               启动:httpd start

               检测启动结果:ps aux | grep httpd

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

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

         

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

    如果上述进展顺利,那我们接下来进行mysql数据库的配置

    命令如下:

     

                 启动:  /etc/rc.d/init.d/mysqld start

                 检查启动结果:  netstat -tulnp | grep :3306

                  修改root密码: mysqladmin -u root password ‘你想设置的密码’

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

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

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

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

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

posted @ 2016-12-21 10:18  庞国明  阅读(196)  评论(0编辑  收藏  举报