Configuring the APACHE+PHP+MYSQL environment under Windows

Source: Internet
Author: User
Tags apache download configuration php mysql download php download

1. Download the relevant installation package

Apache Download:

http://archive.apache.org/dist/httpd/binaries/win32/, choose Httpd-2.2.25-win32-x86-no_ssl.msi

PHP Download:

http://windows.php.net/downloads/releases/archives/, choose Php-5.3.5-win32-vc6-x86.zip

MySQL Download:

http://downloads.mysql.com/archives/community/, select 5.5.28 Windows (x86, 64-bit), MSI Installer download

2. Install MySQL

Note When installing the character set select UTF-8, root password is root

3. Installing Apache

Fill in the Domain name, service name, email

Choosing a Custom Installation

Select Installation Location

In the browser input localhost test installation is successful, if startup fails, check whether Port 80 is occupied.

4. Install the configuration PHP

4.1 Extract Php-5.3.5-win32-vc6-x86.zip to PHP535

4.2 Copy the Php.ini-development file and rename it to PHP.ini

4.3 Edit php.ini file, modify line No. 809, remove semicolon, modify to Extension_dir = "D:/lamp/php535/ext"

Line No. 959, open the mysql,mysqli extension

4.4 Configuring Http.conf

Open D:\LAMP\Apache2.2\conf\httpd.conf, and add the following line after the last LoadModule (around line 130th):

LoadModule php5_module "D:/lamp/php535/php5apache2_2.dll"
Phpinidir "d:/lamp/php535/"
AddType application/x-httpd-php. php. phtml

Around line No. 244 will

<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>

Revision changed to

<ifmodule dir_module>
DirectoryIndex index.html index.php
</IfModule>

5. Testing

Create a test.php file in D:\LAMP\Apache2.2\htdocs with the following content:

<?php

Phpinfo ();

Accessing localhost/test.php in the browser will see that the MySQL extension has been added correctly

Create a sql.php file in D:\LAMP\Apache2.2\htdocs with the following content:

<?php

$conn =mysql_connect ("localhost", "root", "root");

Var_dump ($conn);

Accessing localhost/sql.php in the browser will print out the resource (3) of type (MySQL link). Indicates that the MySQL link was established successfully.

Configuring the APACHE+PHP+MYSQL environment under Windows

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.