WAMP (Win + Apache + MySQL + PHP) - environmental structures

Before using php language development program, we must first set up a development environment in the system, how to build the next record WAMP (Win + Apache + MySQL + PHP), is recommended to create a new directory named WAMP, easy to manage and use prior to installation.

A: Apache Installation

  1. Download the official website address: https: //httpd.apache.org/, click Download to download unzip the package

     

 

    

 

2. Install

  Download extract to a local folder (Note: folders do not appear special characters or Chinese)

          

 

 

3: Configuration

  1. Open the file location: httpd.conf Apache24 \ conf \ under, opened with the editor, found in about 38 lines (the number of different versions may be different rows)

          

   2. Open cmd me here Services already installed, so prompt service has been installed with administrator privileges to the Apache bin directory enter httpd.exe -k install Apache installation services, (delete the service).

          

 

 

   3. (Recommended) httpd.exe added to the system environment variables in order to operate more convenient

 

4: test was successful

  

 

  Open ApacheMonitor.exe bin directory, and browser enter: localhost, appears the following page is the success

          

 

 

 

Two: MySQL Installation unzip

  1: Download the official website address https://www.mysql.com/downloads/ 

  点击MySQL Community (GPL) Downloads »  MySQL Community Server   

           

               

 

 

   Select a system type and the type and corresponding mysql 

           

 

 

   Download after decompression

 

 

 

            

 

 

   Begin configuring mysql

  1. Register mysql service, an administrator opens cmd, enter the bin directory you just unzipped mysql root directory, then the command mysqld install Mysql (take your own name here, but it is recommended to use Mysql) in the window registered service because my computer before registering the mysql service, so prompt service already exists in the current directory service installed on my D drive

           

 

 

   2. Initialize the mysql environment

    通过命令mysqld --initialize-insecure去初始化mysql,此时根目录会多个data目录,(第一次执行需要点时间)

    把mysql的bin目录添加到系统环境变量的Path当中,(我的电脑=>右键属性=>高级系统设置=>环境变量=>系统变量中的Path),方便后面使用mysql

           

 

 

 

  3.启动or关闭 mysql服务

    启动mysql服务: net start mysql

    关闭mysql服务:net stop mysql

    删除window服务:sc delete 服务名

  4.登录mysql 

    第一次安装mysql数据库,在初始化的文件夹,也就是Data文件夹里面的.err文件,该文件中有一个默认密码,

    通过命令:  mysql -u root -p

    输入默认的密码后,使用默认密码后需要修改默认密码才能够正常使用mysql      

          

 

 

       重置密码后即可使用

use mysql;#操作mysql
update user set authentication_string=password(“你的新密码“) where user=”root”;
flush privileges;#刷新表

 

  三:PHP安装

    1.官网整一套,链接地址:https://www.php.net/downloads.php,根据自己的需要下载对应的版本,然后解压到本地

          

 

 

     2.添加PHP模块到本Apache中

    #1.加载php7模块  

    LoadModule php7_module "你的phpapache2_4.dll文件目录"

    LoadModule php7_module "D:/WAMP/php-7.1.10/php7apache2_4.dll"

    #2.加载php文件的后缀

    AddType Application/x-httpd-php .php

    #3.设置php配置文件目录

    PHPIniDir "PHP安装目录"

    PHPIniDir "D:/WAMP/php-7.1.10"

              

 

 

 

     3.重命名php配置文件

    将php.ini-development文件改名为php.ini,这是php开发配置文件,以后在配置和开发当中经常用到

          

 

 

     4.php配置文件的更改

    编译器打开php.ini文件

    ctrl+f:搜索关键词

    搜索关键词:timezone   找到如下,去掉前面的 ; 注释符号;并且设置时区=PRC(中华人民共和国)

            

 

 

        想要开启什么模块就去掉前面的注释符号

            

 

 

 

    

  四:初体验

      

 

 

 

  

 

 

 

 

    

 

 

 

 

  

  

Guess you like

Origin www.cnblogs.com/bai-boy/p/12151742.html