Wampserver Configuration Tutorial in Windows environment

Source: Internet
Author: User
Tags configuration php php server php website phpmyadmin

For the first to make a PHP website for friends, it is certainly hoped that in their own computer is to build PHP environment, save space and upload trouble! But building the environment is not an easy thing, especially for novice students! So here with you to introduce me as a novice in the use of the convenient PHP server erection software, that is wampserver, the software in the process of installation has been Apache, MySQL, PHP inherited good, but also do the corresponding configuration, in addition, Plus the Sqlitemanager and phpmyadmin, eliminating the complexity of the configuration process, allowing us to put more time on program development. It is even more gratifying to note that the software is also completely free. Important: Basically every step to change the configuration file after the end of the operation after restarting the corresponding service will not take effect, that is, if you want to modify the immediate effect, you must save after the changes to restart the corresponding service!

First, the installation of Wampserver installation Wampserver process is very simple, as long as you can click on the next to complete the installation: Click on the diagram

7, in order to select the Default browsing tool: The installation process will be prompted to select the default Browsing tool, as shown, but note that the browser is not the Browse tool Oh, it refers to the Windows browser, that is Explorer.exe, the default is this, directly click "Open" on it.

8, as shown, you will be prompted to enter the administrator mailbox and the Mailbox SMTP Server window, this if you are willing to fill in, you can fill it, but in general, click Next directly on it, will not affect the installation.

OK, the installation is finished successfully! It's simple!

10, after installation, the bottom right corner of the screen will come out a marker, you right-click, and then select Language-chinese,

Look again

11, left-click, and then click "www directory" will open the installation wampserver default home Page folder, but many times, we store the page folder is not in that directory, how to get rid of this directory? Of course there is a way to open the Wampserver installation directory, open the inside of the "script" folder, with Notepad open the inside of the config.inc.php, found "$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. (Note: This change is only a link on the Wampserver <, if not special needs, do not recommend that you change, the real Apache directory is not here, change the way please don't worry, continue to look down. )

Ii. configuration of MySQL and phpMyAdmin

A separate installation of MySQL friends will certainly find a problem, the previous installation of MySQL is required to configure a root password, but when the installation of Wampserver, there is no password to configure the steps, it is not the password MySQL is empty? The answer is yes, it is indeed a blank password.

Wouldn't it be very unsafe? Very right, so we have to change the password ah, hehe

1, left-click, select "PhpMyAdmin", will open the PhpMyAdmin Management page, click on the upper right of the "permissions", the general situation will appear in the table, we have to do is click on each line of user name root to the right.

2, click, find two of the changes shown in the password area, fill in the password to change, and then click on the bottom right of the execution, a moment after the change will appear above the successful prompt, each root user need to do this operation, if 1:30 will not think of a good password, you can also use "Generate password" function to generate a random password, but this password must be remembered, forget the trouble can be big.

Note: After changing the password, you can see that the corresponding account password bar is changed from "No" to "yes", such as the Green circle part. Then add a new user (detailed next), delete the user, such as the Red Mark section to complete the operation!

3, after the above operation to restart the MySQL service, and then refresh the page, we will find that there is an error, which is why?

Because we have just modified the MySQL password, but did not modify the phpMyAdmin and MySQL communication password, how to change it? Open the Wampserver installation directory, open the \wamp\apps\phpmyadmin3.3.9 in turn, and use Notepad or the DW software to open the config.inc.php inside to find "$cfg [' Servers '] [$i] [' Password '] = ";", in the last two single quotes, enter the password you just modified, and then save, after the operation is finished and then refresh the phpMyAdmin page, is it back to normal?

4, finished the above configuration, we need to create a MySQL database user and user corresponding database, again, click on the top right

Permissions button to find a "Add new user" link below the middle offset, create a user and the corresponding database as shown, and give

Single database management permissions, the following resource constraints are based on the actual situation to fill out, the general use of the case that the area can be retained

The default, and then click the "Execute" button in the bottom right corner, the corresponding user and the database is created.

III. Configuration of Apache
Although Wampserver has helped us to integrate the Apache, but some of the details of things still need our own to improve, let us have a pair of wampserver to complete the Apache.

1, just loaded after wampserver, there is no temper more anxious friends may try to access our configured Wampserver server through the external network, but will find through the external network access will prompt insufficient authority, this is why? is because Wampserver by default is only allowed 127.0.0.1 access, that is, only allow native access, how to modify it? Click-apache-httpd.conf, find the place, probably in the No. 234 line, "Deny from all" to delete, and then "Allow from 127.0.0.1" to "let from all", it is OK.

2, continue to search, found two places (in about 190th and No. 225 respectively), respectively, "allowoverride None" changed to "allowoverride all" (This step is for the use of URL rewriting function of friends, This step is not recommended if it is not used, as the security of Apache will be slightly reduced after this change. )

3, turn on the URL rewrite function, of course, if you feel that URL rewriting function is not necessary, this can be ignored directly, but if opened, the second above must be done, otherwise it is easy to cause errors. Follow the above method to open the httpd.conf file, find #loadmodule rewrite_module modules/mod_rewrite.so, and then the front "#" to delete, you can, of course, if you want this

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

4, I believe you remember the above change wampserver "www directory" point to the path of the way it? I once said that this method only changed the Wamp "www directory" this link, then if you want to really change, how should we change it? Very simple, open 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/">", also change the value of the back to our site to store the actual address, OK.

Iv. Configuration php--Important

PHP configuration is relatively simple, only need to make some basic settings to modify, click-php-php.ini,

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.

V. Conclusion

So far, our wampserver configuration can be temporarily over, now you can upload a PHP program to run, experience the joy of success, of course, wampserver and its add-ons is much more than the function of the simple, the purpose of this article is only is to allow everyone to successfully use the Wampserver to build a PHP server environment, then you need to slowly ponder O (∩_∩) o~

Http://www.360doc.com/content/17/0521/19/43338247_655930322.shtml

Wampserver Configuration Tutorial in Windows 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: 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.