Win7php environment setup tutorial: php environment setup steps in win7 _ PHP Tutorial

Source: Internet
Author: User
Win7php environment setup tutorial: detailed steps for building a php environment under win7. Win7php environment setup tutorial: how to build the php environment in win7, php beginners do not know how to build a win7 php environment in a php environment in win7 Tutorial: how to build a php environment in win7

Today, the green tea editor will show you how to build the win7 php environment. if you are new to php and do not know how to build the php environment in win7, this article will help you, the steps are quite detailed ~

Note:

1. download from apache in msi format, click next, OK, and modify httpd. conf for configuration;

2. the configured LoadModule php5_module path must be correctly set. Note that the double quotation marks are English characters;

3. modify the php configuration by reference. Generally, there is no major problem;

4. if apache cannot be started after configuration is complete, the following error occurs: the requested operation has failed;

5. Error correction method: win + r --> cmd --> enter the bin folder in the apache installation directory and enter httpd.exe-w-n "Apache2.2"-k start to find the cause of the error;

6. possible error causes are classified into three types: 1.80 port occupation; 2. software conflict; 3. httpd. conf configuration error.

Start of the official step:

1. install software

1. apache (Apache version: httpd-2.2.15-win32-x86-openssl-0.9.8m-r2, openssl indicates with openssl module, using openssl can configure SSL secure link for Apache );

2, php (PHP version: php-Win32-VC6-x86, VC9 is specifically customized for IIS, VC6 is provided for other WEB service software, such as Apache ).

II. environment configuration

1. configure the website root directory

After apache is installed successfully, enter 127.0.0.1 or locahost in the browser and a message is displayed for It works! The prompt page is under the apache installation directory (htdocs \ index.html). it indicates that htdocs is the default root directory of the website and conf \ httpd is found under the apache installation directory. in the conf configuration file, open the default path to find DocumentRoot, and set the default path (that is, the path of the htdocs file) as the website and directory.

2. load the PHP module and set the PHP configuration file path

Decompress the downloaded php file and place it in a fixed Directory. find the php. ini-production file and rename it php. ini as the php configuration file.

Open the conf \ httpd. conf file in the apache installation directory, find the last # LoadModule statement, and add the following two lines below it.

LoadModule php5_module "F:/wamp/php5/php5apache2_2.dll"

PHPIniDir "F:/wamp/php5"

# The above is my own path. write your own path here, find AddType application/x-gzip. gz. tgz, and add the following two lines below it.

AddType application/x-httpd-php. php

AddType application/x-httpd-php. html

In addition, you need to find the IfModule dir_module and change DirectoryIndex index.html to DirectoryIndex index. php index.html, and finally test whether php is configured successfully. create an index in the root directory of the website. php file, write several lines of php statements, such:

Note: The installed apache version must be the same as the version number in php5apache2_2.dll. Otherwise, an error will occur when loading the php module, prompting Cannot load php5apache2_4.dll into server.

3. configure virtual hosts

Open the conf \ httpd. conf configuration file, find Include conf/extra/httpd-vhosts.conf, remove the # sign before it, and open the conf/extra/httpd-vhosts.conf file for configuration.

Domain name-based virtual host configuration

DocumentRoot "F:/tbcdn" (specify the website root directory)

ServerName static.tianxia.taobao.com (specified access address)

DocumentRoot "F:/xxx" custom

ServerName xxx.com custom

Note: NameVirtualHost *: The 80 statement remains unchanged.

IP address-based VM

DocumentRoot "F:/project" custom

ServerName yjh.com custom

DocumentRoot "F:/xxx" custom

ServerName xxx.com custom

Note: change the NameVirtualHost *: 80 statement

NameVirtualHost 127.0.0.1: 80

NameVirtualHost 127.0.0.2: 80

Finally, bind the IP address to the domain name in the hosts file, and then build the php environment in win7 ~

Http://www.bkjia.com/PHPjc/996046.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/996046.htmlTechArticlewin7 php environment build Tutorial: win7 php environment build detailed steps today green tea Xiaobian brings you win7 php environment build tutorial, if you do not know how to build a php environment in win7...

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.