PHP Learning 0--wampserver installation and configuration

Source: Internet
Author: User

Wampserver is an integrated development package made up of the windows+apache+mysql+php portfolio. By Wampserver, you can build a Web server to provide network services to the outside world.

The process by which a browser browses the Web:

1. After the netizen enters the URL through the browser, the URL is converted to the corresponding IP address via the DNS server, such as 198.1.16.33. Because the default port for the domain name is 80, the final resolved address is 198.1.16.33:80. The network will find the corresponding server based on this IP address-the Apache server we configured.

2. The Apache server then converts the code in the index.html in a directory to the browser that is returned to the client via the URL address, and the browser parses the page content that we see based on the returned code.

3. If we are accessing a PHP file, then Apache will pass the file to PHP for parsing, and after parsing it back to the browser via the Apache server.

4.MySQL is used to store the corresponding data on the server. When you need to commit or read the relevant data, it is through MySQL to read the data.

Configuration of the Wampserver:

Configuration of 1.Apache:

(1). External Network access rights

The newly installed wampserver default is to allow only 127.0.0.1 access, that is, only native access.

1). Find wamp/bin/apache/conf/httpd.conf Open, search onlineoffline tag-don ' t remove. Delete the "Deny from all" under it, and then change the "Allow from 127.0.0.1" to "let from all".

Note: Turning on URL rewriting is not required. (Its role is to set URL rewriting to hide the index.php contained in the URL.) Generally the URL is too long or dynamic URL is not conducive to SEO (Search engine optimization: improve the site in search engine keywords natural rankings , in order to achieve better search to this site). So the hidden goal is to achieve a better SEO effect. )

2). Continue the search, find the two places (respectively, on the 190th and No. 225 lines), respectively, the "allowoverride None" changed to

"AllowOverride All" (This step is for the use of URL rewriting features of friends, if not used this step is not recommended to make changes, because

After this change, Apache's security will be slightly reduced. )

3). Turn on URL rewriting, of course, if you think the URL rewriting function is not necessary, this can be directly ignored, but if you open the

, the second above must be done, otherwise it is easy to cause errors. Open the httpd.conf file by using the method above to locate

#LoadModule Rewrite_module modules/mod_rewrite.so, and then the front "#" to delete, it is OK, of course, if you want this

Changes to take effect, you will need to restart the Apache service immediately.

(2). To modify the Wampserver Web page file storage directory:

1). Modify the location of the WWW file in the wampserver. Open the Wampserver installation directory, open the inside "script" folder, open the inside with Notepad config.inc.php, find "$wwwDir = $c _installdir." /www '; ", change to the directory you want to do, such as change to D:\website, the corresponding code is $wwwdir = ' d:/website '; (note that the" \ "under windows that represents the path must be changed to"/"here). Then turn the wampserver off and then on, and the WWW directory becomes the D:\website we set.

2). Modify the location of the WWW file in Apache. Open wamp/bin/apache/conf/httpd.conf, look for "DocumentRoot" in the 178th line, the value of the back to our actual site needs to change the path, and then look for "<directory" c:/wamp/www/" > ", we also change the value of the back to the actual address stored on our site, OK.

Configuration of 2.PHP

(1). Modify hardware configuration parameters:

Open C:\wamp\bin\php\php5.5.12\php.ini File

Find these three places: Short_open_tag = OFF (Is it allowed to use the abbreviated form of the PHP Code start flag (<??>). );

Memory_limit = 128M (maximum size of memory used);

Upload_max_filesize = 2M (maximum number of uploaded attachments),

The first need to change to on, otherwise a lot of PHP programs will not work, the latter two will be in accordance with the actual needs of everyone to change the line.

Configuration of 3.MySQLd

(1). Connect the MySQL server password settings:

Wampserver configuration of multiple domains:

when we debug a PHP project, we run the PHP project in the browser's address bar through the http://localhost/127.0.0.1+ directory, but when we have multiple projects under the same site root, the http:// localhost/127.0.0.1+ the way the catalog is debugged is cumbersome. If you can configure the corresponding domain name for each project, it is much easier to access the corresponding project through this domain name. To Configure the domain name step:1. Open the Hosts file in the computer operating system directory; C:\Windows\System32\drivers\etc\hosts add domain name: 127.0.0.1 kuaican.com 2. Open Wamp Apache profile HT tpd.conf, httpd.conf Path: E:\wamp\bin\apache\Apache2.2.21\conf\httpd.conf Open file httpd.conf file, search for include conf/extra/ httpd-vhosts.conf remove the # in front of it and save the file 3. Open E:\wamp\bin\apache\Apache2.2.21\conf\extra\ httpd-vhosts.conf file, add a domain name Mapping entry, usually at the end of the file add: <virtualhost *:80> ServerAdmin[email protected]DocumentRoot "E:/wamp/www/moxuehome" ServerName moxue.com serveralias moxue.com errorlog "Logs/www.haha Ha.com-errlo.log "Customlog" Logs/www.hahaha.com-access.log "common</virtualhost> 4. Restart Wamp after saving, At this time through the newly configured kuaican.com domain name can access the corresponding project;

PHP Learning 0--wampserver installation and configuration

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.