Introduction to building a local WAMP environment _ PHP Tutorial

Source: Internet
Author: User
Tags mysql download php download
Let's talk about how to build a local WAMP environment. The so-called WAMP environment built in the local WAMP environment is the development and running environment of Windows + Apache + Mysql + PHP. this is the most basic step for us to learn about php development, although we are talking about how to build a local WAMP environment

The so-called WAMP environment is the development and running environment of Windows + Apache + Mysql + PHP. this is the most basic step for us to learn about php development, although it is said that the integrated development environment should focus on development, but as a basic skill, it must be learned.

During the local php setup process, the php environment configuration is a crucial part. This article briefly describes the configuration of php in the local environment. For everyone to learn!

Configure the development and running environment for Windows + Apache + Mysql + PHP

Install Apache

Obtain Apache Server download

This is the window executable program that includes the open ssl module and runs and installs it directly under the Directory we need to place. Use Port 80 to access the local Http Server without specifying an additional port number.

After everything is installed, open the browser and enter http: // localhost for testing. if "It Works" appears, the installation is successful.

Install Mysql

Obtain Mysql download

Install Mysql. this is the packaged installation package. you can install it all the way as prompted.

There is also a Mysql Workbench, which is a visual Mysql management software that can be used together or used by other convenient management clients.

Use the management client to connect to the local Mysql instance. if the local Mysql instance can be connected, the installation is successful.

Install PHP

Get PHP download. We can see that multiple versions provide us with the following options:

If the Apache version is 1 or 2, download the version compiled by VC6.

If IIS is used as the Server, use the version compiled by VC9.

X86 represents a 32-bit operating system, while X64 represents a 64-bit operating system.

Thread Safe and Non-Thread Safe depend on how the Web Server executes PHP. If it is an ISAPI, you need to call the dll to process user requests. since the related dll does not disappear immediately after processing, you need to perform a thread security check to use multiple threads to improve efficiency, it is better to use Thread Safe. For Fast CGI, because only single-thread running is performed, there is no need to perform a security check under concurrent threads. removing the thread security check is equivalent to canceling unnecessary System consumption, thus improving the running speed, it is better to use Non-Thread Safe.

There is also a direct installation package, which can be directly installed, but we select the ZIP package for manual installation to make manual installation more flexible, and to understand the internal structure of PHP, this is important for further use of PHP in the future.

Decompress the compressed package to your target disk directory. for example, the decompressed directory is similar to C: \ php. Note that spaces are not recommended between directories, because some Web servers may not support spaces.

Configure the php5ts. dll environment variable. Some dll files in the root directory contain the Web Server name. these related Server modules make the Web Server more efficient when running PHP. Php5ts. dll is required for all modules. Therefore, you need to let the system know its location. the search order is generally:

The execution location of php.exe, or the execution Directory of the Web Server (usually bin). If the Web Server uses the server module

PATH included in environment variable PATH

Add the current root directory to the PATH so that the system can find php5ts. dll no matter how configured the Web Server.

Configure the PHP initialization information and directly copy the php. ini-production file and change it to php. ini. the PHP file will be automatically searched and read during runtime. In addition, if you use the NTFS format on Windows NT, 2000, XP, or 2003, make sure that the user running the Web Server has the permission to read php. ini.

Associate PHP with Apache. after this configuration, Apache will be able to parse PHP. There are two ways to set up the collaboration between PHP and Apache. One is CGI, and the other is installed as an Apache Module. the Server module mentioned above is better. Therefore, I install it in this way and add the following three lines to the httpd of Apache. conf.

The code is as follows:

LoadModule php5_module "c:/php/php5apache2_2.dll"

AddType application/x-httpd-php. php

PHPIniDir "C:/php"

Integration detection

Finally, check whether our environment works normally.

Create a text name with the extension test. ini

Add the following code to the file:

The code is as follows:

  

Phpinfo ();

?>

Put it in the htdocs directory of Apache Server

Enter http: // localhost/test. php in the browser. if the PHP version and component statistics are displayed, it means it is working properly. If mysqlnd is enable, the Mysql driver is enabled.

This is a WAMP environment that is the basis for development and learning. Finally, I wish you a pleasant learning experience...

The above is all the content of this article. I hope you will like it.

The so-called WAMP environment of Ghost is the development and running environment of Windows + Apache + Mysql + PHP. this is the most basic step for us to learn about php development...

Related Article

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.