Installation and use of Wampserver

Source: Internet
Author: User

First, click Wampserver.exe Default Installation

Second, after the successful installation test (1)Test the basic configuration        Browser address bar inputhttp://localhost/index.phperror occurred:            You don't have permission to access/on the This server    Address field Input: http://127.0.0.1/index.php success    Error Reason: Configuration issue
    Workaround:
            Find httpd.conf and open it with Notepad.httpd.conf, and then
    1. <Directory/>
    2. Options FollowSymLinks
    3. AllowOverride None
    4. Order deny,allow
    5. Deny from all
    6. </Directory>
Switch
  1. <Directory/>
  2. Options FollowSymLinks
  3. AllowOverride None
  4. Order deny,allow
  5. Allow from all
  6. </Directory>
The following
    1. # onlineoffline tag - don‘t remove
    2. Order Deny,Allow
    3. Deny from all
    4. Allow from 127.0.0.1
    5. </Directory>
whichDeny from allSwitchAllow from all ,Restart all services Now with the browserrespectivelyType the previous two address bar can be successfully accessed, click on the page link phpmyadmin time appears "You don't have permission to access/phpmyadmin/on the this server. " Workaround:
        use Notepad to open the phpadmin.conf in the alias directory in the Wamp installation directoryfile (e.g.)Will
  1. <Directory"D:/wamp/apps/phpmyadmin3.4.10.1/">
  2. Options Indexes FollowSymLinks MultiViews
  3. AllowOverride all
  4. Order Deny,Allow
  5. Deny from all
  6. Allow from 127.0.0.1
  7. </Directory>
whichDeny from allSwitchAllow from all ,Restart all services (2)test MySQL In the browser address bar, type: locahost/testmysql.php An error occurred: Open the testmysql.php code as in Notepad as follows
  1. <?php
  2. $link = mysql_connect(‘hostname‘,‘mysql_user‘,‘mysql_password‘);
  3. if(!$link){
  4. die(‘Could not connect to MySQL: ‘. mysql_error());
  5. }
  6. echo ‘Connection OK‘; mysql_close($link);
  7. ?>
Check out the PHP Manual: mysql_connect () function where parameters:    hostname:        MySQL Server. You can include a port number, such as "Hostname:port", or a path to a local socket, such as ":/path/to/socket" for localhost.       mysql_user:         user name. The default value is determined byMysql.default_userdefined. In theSQL security Mode, the parameter is ignored and always uses the user name of the server process owner.   Mysql_password:
        password. The default value is determined byMysql.default_passworddefined. In theSQL security Mode, the parameter is ignored, and a blank password is always used.
Wampserver in the default installation when the user name of MySQL and the user password are the default, do not need to add parameters, where the server name defaults to localhost:3306   rewrite the above code to:
  1. <?php
  2. $link = mysql_connect(‘localhost:3306‘);
  3. if(!$link){
  4. die(‘Could not connect to MySQL: ‘. mysql_error());
  5. }
  6. echo ‘Connection OK‘; mysql_close($link);
  7. ?>
Retype the address, the link succeeds (for example):
To Add a link password:
  1. # The following options will be passed to all MySQL clients
  2. [client]
  3. password=1234
  4. port=3306
  5. socket=/tmp/mysql.sock
Under [client] add password =xxxx you want to add the password in [Wampmysqld] under the password=xxxx added, save
  1. [wampmysqld]
  2. password =1234
  3. port= 3306
  4. socket= /tmp/mysql.sock
  5. key_buffer = 16M
  6. max_allowed_packet = 1M
  7. table_cache = 64
  8. sort_buffer_size = 512K
  9. net_buffer_length = 8K
  10. read_buffer_size = 256K
  11. read_rnd_buffer_size = 512K
  12. myisam_sort_buffer_size = 8M
  13. basedir=D:/wamp/bin/mysql/mysql5.5.20
  14. log-error=D:/wamp/logs/mysql.log
  15. datadir=D:/wamp/bin/mysql/mysql5.5.20/data
This time the source code in testmysql.php is modified to:
  1. <?php
  2. $link = mysql_connect(‘localhost:3306‘,‘1234‘);
  3. if(!$link){
  4. die(‘Could not connect to MySQL: ‘. mysql_error());
  5. }
  6. echo ‘Connection OK‘; mysql_close($link);
  7. ?>
Re-type in the browser address bar to display the link successfully

From for notes (Wiz)

Installation and use of Wampserver

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.