Windows7 Build Wamp Environment

Source: Internet
Author: User
Tags phpinfo temporary file storage

Wamp:Windows + Apache + MySQL + PHP

First, in Dunder the packing directoryNew Catalog Wamp,WampList of directories under constructionwwwand thebin,wwwdirectory as the site file entry directory,binList of directories under constructionApache2.4.23,Php7.0.9,Mysql5.7.13, respectively asApache,PHPand theMySQLthe installation directory.

1. Apache Installation and configuration:

(1) Apache Download (official website):

Select the latest version of 2.4.23, and click "Files forMicrosoft Windows".

apache apachehaus http:// WWW.APACHEHAUS.COM/CGI-BIN/DOWNLOAD.PLX and select the windows version, select here Span style= "FONT-FAMILY:CALIBRI;" >apache2.4   vc11 64 windows system selection), download.

After the download is complete, unzip to the wamp/bin/apache2.4.23 directory.

(2) Apache configuration file D:\wamp\bin\Apache2.4.23\conf\httpd.conf modified:

Define srvroot "D:\wamp\bin\Apache2.4.23".

Listen(cmd use command netstat-a to see If your port is occupied, then change to another port)

(3) Apache Master Service installation and configuration:

In cmd, enter "D:\wamp\bin\Apache2.4.23\bin\httpd.exe" - k install-n Apache , installation Apache service, and name the service Apache .

Tips for Successful installation:

In the installation directory bin directory found ApacheMonitor.exe, double-click to run the file, in the lower right corner of the desktop appears an icon, double-click the icon, the window interface appears:

Click "Start" to launch the Apache service.

Access to the http://localhostin the browser, the following interface indicates that the Apache sub-server basic configuration has been completed.

Apache default Site Directory for the htdocs folder, if you need to change the site directory, you must modify the corresponding Apache configuration. Locate the "documentroot" configuration item in profile httpd.conf and change its value to just the correct directory for the site, and change it to "D:/wamp /www".

DocumentRoot "${srvroot}/htdocs" instead:documentroot "D:\wamp\www"

<directory "${srvroot}/htdocs" > change to:<directory "D:\wamp\www" >

Restart the Apache service. You can cut the index.html file in the original htdocs directory to the new site directory for testing, and if you can access it, the site directory is modified successfully.

Modify the project portal file configuration directoryindex: Generally we are index.php,index.htm, index.html as a Web entry to the project, Apache The default entry is only index.html , we can manually add support for the other two entry files:

DirectoryIndex index.html Change to:directoryindex index.php index.htm index.html

2. PHP Installation and configuration:

(1) PHP Download (official website):

Select php7here and click on "Windows downloads":

With the Apache Environment, the choice is "Thread Safe" version, the same choice ,VC14 , download, unzip to the D:\wamp\bin\Php7.0.9 directory.

(2) PHP configuration file modification:

Copy the file D:\wamp\bin\Php7.0.9\php.ini-development, and change the file name to php.ini. Open the php.ini file and modify the values for the following configuration items:

Date.timezone = Asia/shanghai

To activate php Extensions (remove the comment symbol '; '):

Extension_dir = "D:\wamp\bin\Php7.0.9\ext"// Extended directory









Doc_root = "D:\wamp\www"// website Entry directory

Session.save_path = "D:\wamp\phpsessiontmp"//session file storage location

Upload_tmp_dir = "D:\wamp\phpfileuploadtmp"// upload file Temporary file storage location

3. Configure Apache to support PHP:

Open theLoadModule vhost_alias_module in the Apache configuration file conf/httpd.conf "Configure (remove the previous comment ) # "), and add the following configuration below:

LoadModule php7_module "D:\wamp\bin\Php7.0.9\php7apache2_4.dll"

Phpinidir "D:\wamp\bin\Php7.0.9"

AddType application/x-httpd-php. php. html. htm

There is a huge pit here, because php7 is compiled by VC14, so you need to install VC2015(that is, VC14 ) Run-time environment, or restart Apache The following error message will appear:

VC14:, click to download and install, note the installation VC14 the 3 service must be turned on , otherwise the installation will fail:

Windows Modules Installer,windows Update,windows Defender.

after installing VC14 and then restarting Apache, write a php file called phpinfo (), named phpinfo.php, place the file in the D:\wamp\www directory, in the browser access http://localhost/ phpinfo.php, the following interface shows that Apache has successfully supported PHP.

4. installation and configuration of MySQL:

(1) Mysql Download (official website):

Click "Downloads", select "Windows", download the mysql installation package, then click Install, there may be a " this application requires. NET Framework4.0. "error message, so you need to install it first . NET Framework4.0. :

Install and then continue with MySQLinstallation.

(2) MySQL installation:

Here the installation process will appear a pit:

is to choose to install components, you need to click on the right side of the selected components before the "Advanced Options", click before the installation directory and data storage directory selection, here to install MySQL to D:\wamp\ The bin\mysql5.7.13 directory.

The MySQL installation process is relatively slow.

After the installation is completed, write a PHP script to test if you can successfully connect to mysql, if you can successfully connect the mysql has been installed successfully, PHP is ready to support Mysql .

At this point, theWAMP Development environment has been all manually installed configuration success!!!

Windows7 Build Wamp Environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.