Tutorial on building a php environment (apache + php + mysql) in windows

Source: Internet
Author: User
Tags php development environment vc9
Tutorial on building a php environment (apache + php + mysql) in windows
For a tutorial on setting up a php development environment in windows, the php environment is built based on apache + php + mysql. for a very detailed php configuration tutorial, refer. 1. preparation-download the required software apache httpd-2.2.22-win32-x86-openssl-0.9.8t.msiphp php-5.3.10-win32-vc9-x86.zipmysql mysql-5.5.20-win32.msi

II. install software

Install apache: Double-click installation, which is no different from installing other windows software. when you enter server infomation, there is no special rule as long as the entered information conforms to the format.

After the installation is complete, enter http: // localhost in the browser. if it works is displayed !, Indicates that apache is successfully installed.

Install php: Extract php-5.3.10-win32-vc9-x86.zip to a directory.

Install mysql: Double-click the installation. to change the installation directory, select custom in choose setup type.

After the installation is complete, start configuring mysql. keep all the default options, but you 'd better change the default mysql encoding to utf8. set the password in the modify security settings option and enter the password twice, click execute to complete the configuration.

3. integrate apache + php + mysql

Apache: first, modify the apache configuration file so that apache can parse the php file. The apache configuration file is httpd. conf in the conf Directory of the apache installation directory.

1. apache can parse the php file and find it in the configuration file.

# Loadmodule vhost_alias_module modules/mod_vhost_alias.so

Add in the next line (the green position depends on the directory where php is located)

Loadmodule php5_module"D:/develop/php/php5apache2_2.dll"Phpinidir"D:/develop/php"Addtype application/x-httpd-php. php. html. htm

2. find

Directoryindex index.html

Change

DirectoryindexIndex. phpIndex.html

3. modify the Directory of the apache site and find it in the configuration file (the directory for apache installation is different and the displayed value is different)

Documentroot"D:/develop/apache2.2/htdocs"

Change

Documentroot"D:/workspace/php"

Find

D:/develop/apache2.2/htdocs">

Change

D:/workspace/php">

Php: rename php. ini-development to php. ini as the php configuration file. Modify php. ini

1. set the Directory of the php extension package and find

; On windows:; extension_dir = "ext"

Change to (the value is the Directory of the ext folder)

; On windows: extension_dir ="D:/develop/php/ext"

2. enable the corresponding library function and find the row of the library to be enabled

; Extension = php_curl.dll

; Extension = php_gd2.dll

; Extension = php_mbstring.dll

; Extension = php_mysql.dll

; Extension = php_xmlrpc.dll

Remove the semicolon (comment) and change it

Extension = php_curl.dll

Extension = php_gd2.dll

Extension = php_mbstring.dll

Extension = php_mysql.dll

Extension = php_xmlrpc.dll

3. set the time zone and find

; Date. timezone =

Change

Date. timezone = asia/shanghai

After the configuration is complete, check whether the configuration is successful. Restart apache, create the file index. php in the site directory, and enter the following content:

Open the browser and enter http: // localhost. if the following content is displayed, the installation is successful and mysql is associated successfully.

In this way, the installation and configuration of apache + php + mysql are completed.

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.