Windows Wamp (Apache, MySQL, PHP) Installation tutorial

Source: Internet
Author: User
My original Website: www. phpthinking. comarchives379 recently many php beginners have asked questions about how to configure "WindowsApacheMySQLPHP". I have answered them here. WampServerApacheMySQLPHP many website developers prefer to write and test their programs on their desktops.

Personal Original Web site: http://www.phpthinking.com/archives/379 recently many php beginners are asking about "WindowsApacheMySQLPHP" how to configure the problem, here to answer together. WampServer = ApacheMySQLPHP many website developers prefer to write and test their programs on their desktops.

Personal Original Web site: http://www.phpthinking.com/archives/379


Recently, many php beginners have asked questions about how to configure "Windows + Apache + MySQL + PHP". I will answer them here.

WampServer = Apache + MySQL + PHP

Many website developers like to write and test their programs on their desktops. There are several advantages to doing so. First, you can easily test programs without uploading files to the server, especially for some simple modifications, it can save a lot of time; another advantage is that program bugs won't mess with servers, No matter what crazy behavior they have, it is only limited to a folder on your computer, and will never anger service providers, other users on the server, other systems on the server, or your boss. This article will introduce how to set up Apache2, MySQL, and PHP on Windows 7, the so-called "WAMP" architecture-Windows + Apache + MySQL + PHP.

Download WampServer

WampServer is a suite that integrates Apache (website server), MySQL (Database System), and PHP. That is to say, we only need to install WampServer once, which is equivalent to installing the above four software separately, in addition, you do not need to manually change the detailed settings of each software, because the author of the suite has completed the relevant settings. [Screen dump of wampserver.com main page]

WampServer is divided into 32-bit and 64-bit versions. If your Windows system is 64-bit, both versions can be used for reading, but it is best to use the matching 64-bit version. To identify whether your Windows is 32-bit or 64-bit, you can click Start, right-click computer, and then click content 」, under system, you can see the system type.

Install Wamp Server

Step 1: Execute the downloaded file. The "User Account Control" dialog box may pop up in Windows, asking you to authorize or approve the file. please press "Yes 」.

Step 2: The Next dialog box lists the Apache, MySQL, PHP, PHPMyAdmin, SQLBuddy, and XDebug versions to be installed. Click "Next.

Step 3: confirm the copyright and license. Click "I accept the agreement" and then click "Next 」.

Step 4: select the installation path. If you have no special requirements, click "Next 」.

Step 5: Determine whether to install WampServer in the "Quick Start tool" and "desktop", and click "Next 」.

Step 6: Repeat the installation options here. If you want to change your mind, click Back. If you are sure, click Install to start the installation.

Step 7: the installation process takes about one to two minutes.

Step 8: WampServer asks you what is your preset browser. It uses IE as the preset browser automatically. If you use Firefox or Chrome, please tell WampServer the program location, click Open 」.

Step 9: WampServer will attempt to start the Apache website server. The Windows Firewall may intercept network communication between the server. In this case, you need to authorize the Apache server. In the dialog box below, we recommend that you click "Private networks, such as my home or work ntetwork" and then click "Allow access 」.

Step 10: Enter the PHP mail () parameter. This PHP letter is used to send an email. After setting the parameter, you can send an email on this computer using this PHP letter. If you do not want to use this PHP letter, you can skip this step. You can also manually edit the php. ini file (PHP configuration file) in the future. The first parameter SMTP is the name of the email sending server. If your computer has an SMTP server, you can apply the preset localhost. If not, you can enter the SMTP server provided by your ISP. The second parameter Email is the preset sender address. you can change it to your own Email address or retain the preset you @ yourdomain. Click "Next 」.

Step 2: WampServer has been installed. You can choose whether to immediately start the WampServer Management Program. By default, it is started. I suggest you start it for testing now. Click Finish to complete the installation.

Configuration Settings

The WampServer installer automatically sets system parameters for us, which is enough for Apache, MySQL, and PHP to work closely together, so that you can start to write applications, the following describes some of the parts that may need to be modified to meet your work habits and system configurations. Note that after modification, you must restart the Apache server to make the new parameters take effect.

After WampServer is installed, the WampServer management program starts automatically. If not, you can start the red "W" icon on the desktop or in the shortcut column. The "User Account Control" dialog box may pop up in Windows, you are required to authorize the management program to modify Windows Settings. Click "Yes" to continue. After the startup, the management program automatically starts the Apache and MySQL servers. The Green "W" icon is displayed in the Windows work column, indicating that all server systems have been started successfully.

Set the IP address of localhost

Some Windows systems cannot interpret localhost as your computer. In this case, you need to modify the hosts file of one of Windows systems and enter the static IP address of localhost. First, go to the File Manager path "C: \ Windows \ System32 \ drivers \ etc". You will see the hosts file. use NotePad to open the file and add "127.0.0.1 localhost 」, as shown in, and then save the file. This modification takes effect immediately without restarting Apache.

Change the home directory path of a website

The path of the website's main directory is managed by Apache. Therefore, we must first enable the Apache configuration file httpd. conf, in the notification area on the right of the Windows work column, click the green "W" icon of WampServer, click "Apache" in the "WAMPSERVER 2.2" menu, and then click "httpd. conf 」.

Use the search function to find the keyword "DocumentRoot". The following path is the home directory of the website.

After modifying DocumentRoot, you must modify the Directory that is located at around 203.

After the archive is set up, in the notification area on the right side of the Windows work column, click the green "W" icon of WampServer, in the "WAMPSERVER 2.2" menu, click "Apache", click "Services", and then press "Restart Service" to Restart Apache.

Test Server

After WampServer is installed, the WampServer management program starts automatically. If not, you can start the red "W" icon on the desktop or in the shortcut column. The "User Account Control" dialog box may pop up in Windows, you are required to authorize the management program to modify Windows Settings. Click "Yes" to continue. After the startup, the management program automatically starts the Apache and MySQL servers. The Green "W" icon is displayed in the Windows work column, indicating that all server systems have been started successfully.

Click "localhost" in the WampServer menu. the browser will enable http: // localhost/. If the Apache server is not started at this time, an error message will appear.

After the Apache server is enabled, you will see the preset home page. If it is successful, your Apache server and PHP are operating normally.

Here we can see what WampServer has installed, such as Apache 2.2.21, PHP 5.3.9, MySQL 5.5.20, and some Extensions of PHP. These are the extension libraries of PHP, and there are two shortcuts, one is phpinfo (), which is a very special PHP function used to display important server information, including the detailed configuration of PHP; the other is phpmyadmin, this is one of the three additional tools and software for WampServer to manage the MySQL database.

Click the phpmyadmin link to enter PhpMyAdmin. If the connection succeeds, the MySQL database server operates normally.

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: info-contact@alibabacloud.com 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.