WAMP Environment Construction

Source: Internet
Author: User

Niche has been daoteng PHP for some things lately. Just getting started, so some things in the learning process are sorted out. The first is about the construction of the WAMP environment and the construction of virtual machines. Small white One, the great god please ignore it.

To build the necessary software, you can go to the following link to find. http://pan.baidu.com/s/1i3AgY93

    • It is recommended to build a Wamp folder with Apache, MySQL, PHP, and WWW directories below.
    • Installation

Apache is set to hostname during installation, then Apache is installed in the Wamp directory;

PHP is extracted directly into the PHP directory;

MySQL installation settings, SetupType Select Custom can set the installation path (no special requirements can choose typical), select the installation path to the MySQL directory->configure the MySQL server now select Configure MySQL->detailed configuration custom config->developer machine (select development mode, take up less resources)->multifunctionl Database (select the type of databases function, General Universal Multifunction)->manual setting (set the number of connections, generally do not need to be too large, default), set the port (default 3306), select the encoding type (the UTF8 of the third option)- > Create a password and execute it

    • Configure Apache

Open httpd.conf in the Conf directory in the Apache directory

Search DocumentRoot, change the default directory to the path of the WWW directory

<directory "E:/wamp/www" in the back, change the default directory to the path of the WWW directory

Search index.html Add index.php will change PHP file to default open file (Apache default to view the WWW directory folder and files, the field added on this line will be opened by default when the folder opens)

Add the following fields at the end of the file to associate PHP:

LoadModule php5_module "E:/wamp/php/php5apache2_2.dll"
AddType application/x-httpd-php. php
Phpinidir "e:/wamp/php"

Restart Apache, and then type localhost in the browser, and if the It works field appears, the Apache configuration succeeds.

PS: If the configuration error, cannot restart Apache, you can right-click on my Computer Select "Management"--Event Viewer->windows Log--application to see the cause of the error. If this is still not possible, or if the configuration file is compromised, you can open the initial httpd.conf under original in the Conf directory and reconfigure

    • PHP Configuration

Copy the PHP directory php.ini-development file and rename it to PHP.ini

Open php.ini, search extension, extension=php_gd2.dll,extension=php_mbstring.dll,extension=php_mysql.dll,extension=php_ Mysqli.dll in front of the comment. (gd2 Library, string handling, MySQL extension.) The specific expansion module depends on the needs of the individual)

Search for Extension_dir and change the path to the path of the Ext folder in PHP

Also restart Apache, and then create a new ' test.php ' in the WWW directory, type the following fields:

<?php phpinfo ();? >

If PHP version related information appears, then PHP and Apache Association success

    • MySQL Configuration

Extract the phpMyAdmin to the phpMyAdmin directory under the WWW directory

Ps:

MySQL is actually ready to use after configuring PHP.ini.

Create a new test.php under the WWW directory

Type:

<?php

$coon =mysql_connect (' localhost:3306 ', ' root ', ' password ');

if ($conn) {

Echo ' connection succeeded ';

}

else{

Echo ' Connection failed ';

}

?>

If the connection is successful, the MySQL and PHP connections are complete.

PS: Because the maximum value of phpMyAdmin transfer file is determined by the maximum file upload value in PHP, and it is seldom to modify this value in PHP configuration, the environment variable is usually set for MySQL. (Some versions of MySQL can be set up directly during the installation process.)

Right-click on the advanced system settings under properties of my Computer, select environment variable, find the Path field, use a semicolon, split the bin directory path under MySQL to add to path

Then open cmd command line: Type mysql-u root-p Enter password

Type use test; (test is an empty database or a database name that you built in phpMyAdmin)

Type souece and drag the database you want to import into the cmd window to import the database (typically with the import of phpMyAdmin, this method can be used if the imported database is large)

  

  

WAMP Environment Construction

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.