How to configure the apache + php + mysql environment in windows

Source: Internet
Author: User
Tags mysql connect
: This article describes how to configure the apache + php + mysql environment in windows. if you are interested in the PHP Tutorial, refer to it. Preparations
1 download apache http://httpd.apache.org/download.cgi#apache24 httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
Openssl indicates that the openssl module is included. you can use openssl to configure an SSL secure link for Apache.
2 Download php http://windows.php.net/downloads/releases/archives/ php-5.3.5-Win32-VC6-x86.zip
Download vc6
VC6: legacy Visual Studio 6 compiler, which is compiled using this compiler.
VC9: the Visual Studio 2008 compiler is compiled using Microsoft's VS editor.
3. download mysql http://mysql.llarian.net/Downloads/MySQL-5.5/mysql-5.5.23-winx64.msi
Installation 2
1. apache is relatively simple. it can be completed one by one.

Browser verification. The page appears. the verification succeeds.

2 php installation

Download the zip package and decompress it to a directory. rename the directory to php.

3 mysql
Omitted
Three configurations
Php configuration
Rename the php. ini-development file to php. ini.
Specify the Directory of the PHP extension package to call the corresponding DLL file

The code is as follows:


; Directory in which the loadable extensions (modules) reside.
Http://php.net/extension-dir
; Extension_dir = "./"
; On windows:
; Extension_dir = "ext"


Change

The code is as follows:


; Directory in which the loadable extensions (modules) reside.
Http://php.net/extension-dir
; Extension_dir = "./"
; On windows:
Extension_dir = "D:/servers/php/ext"


Remove the following configuration notes to support mysql

The code is as follows:


Extension = php_curl.dll
Extension = php_gd2.dll
Extension = php_mysql.dll
Extension = php_pdo_mysql.dll
Extension = php_pdo_odbc.dll


Support session
Session. save_path = "e:/temp"
Upload file directory configuration
Upload_tmp_dir = "e:/temp"
Time zone configuration
Date. timezone = Asia/Shanghai
Apache configuration
Under # LoadModule vhost_alias_module modules/mod_vhost_alias.so, add

The code is as follows:


LoadModule php5_module "e:/servers/php/php5apache2_2.dll"
PHPIniDir "e:/servers/php"
AddType application/x-httpd-php. php. html. htm


Modify the web home directory

The code is as follows:


DocumentRoot "D:/servers/Apache2.2/htdocs"


Change

The code is as follows:


DocumentRoot "D:/servers/phpweb"

The code is as follows:



Change

The code is as follows:


The code is as follows:



DirectoryIndex index.html


Change

The code is as follows:



DirectoryIndex index. php index.html


Restart apache
Mysql configuration
Omitted
4. test
Create the PHP web directory D: \ servers \ phpweb
Create a test file index. php

The code is as follows:


Phpinfo ();
?>


Browse: http: // localhost
The following information is displayed, indicating that the configuration is successful:

Create a mysql connection test file

The code is as follows:


$ C/> if (! $ Connect) echo "Mysql Connect Error! ";
Else echo "mysql connection successful ";
Mysql_close ();
?>

The above describes how to configure the apache + php + mysql environment in windows, including related content, and hope to help those who are interested in the PHP Tutorial.

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.