Win7 PHP Environment Building tutorial: Win7 PHP Environment building Steps _php Tutorial

Source: Internet
Author: User

Win7 PHP Environment Building tutorial: Win7 PHP Environment Construction steps


Today's green tea Small series to everyone is Win7 PHP environment building tutorial, PHP Novice If do not know how to build PHP environment under Win7, then this article can help you, the steps are very detailed OH ~

Here are some things to note:

One, Apache choose MSI format download, all the way Next,ok, modify the httpd.conf configuration;

Second, the configuration of the LoadModule php5_module path must be set correctly, and pay attention to double quotation marks for English characters;

Third, the PHP configuration can be modified according to reference, generally no major problems;

Four, configuration completed Apache can not start error: The requested operation has failed;

V. Error Correction method,win+r-->cmd--> Enter the Bin folder in the Apache installation directory, enter: Httpd.exe-w-n "Apache2.2"-start to find the cause of the error;

Six, possible causes of error is classified as three categories: 1.80 port occupancy; 2. Software conflicts; 3:httpd.conf configuration error.

Formal steps to start:

First, install the software

1, Apache (Apache version: Httpd-2.2.15-win32-x86-openssl-0.9.8m-r2,openssl with OpenSSL module, using OpenSSL to configure SSL secure link to Apache);

2, PHP (PHP version: PHP-WIN32-VC6-X86,VC9 is specifically designed for IIS, VC6 is for other Web services software provided, such as Apache).

Second, the Environment configuration

1. Configure the Web site root directory

After the Apache installation succeeds, the browser input 127.0.0.1 or locahost will prompt it works! this prompt page in the Apache installation directory (htdocs\index.html), stating Htdocs as the site default root directory, Locate the conf\httpd.conf configuration file under Apache's installation directory, open the Find documentroot default path, and set a custom path for the default path (that is, the path to the Htdocs file) as the site and directory.

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

Unzip the downloaded PHP file and place it in a fixed directory, locate the Php.ini-production file and rename it to php.ini as the PHP configuration file.

Open the conf\httpd.conf file in the Apache installation directory, locate 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"

#以上是我自己的路径, write your own path here, find AddType application/x-gzip gz tgz, add the following two lines below it

AddType application/x-httpd-php. php

AddType application/x-httpd-php. html

Also need to find Ifmodule dir_module, change DirectoryIndex index.html to DirectoryIndex index.php Index.html, finally test whether PHP is configured successfully, create a new index.php file in the root directory of the Web site, write a few lines of PHP statements, such as:

NOTE: The Apache version installed must be the same as the version number in Php5apache2_2.dll, otherwise loading the PHP module will be an error, prompting cannot load Php5apache2_4.dll into server.

Third, configure the virtual host

Open the Conf\httpd.conf configuration file, locate the include conf/extra/httpd-vhosts.conf, remove the # number in front of it, and open the conf/extra/httpd-vhosts.conf file for configuration.

Domain-based virtual host configuration

DocumentRoot "F:/tbcdn" (Specify site root directory)

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

DocumentRoot "F:/xxx" Custom

ServerName xxx.com Custom

Note: Namevirtualhost *:80 statement does not change

IP address-based virtual host

DocumentRoot "F:/project" Custom

ServerName yjh.com Custom

DocumentRoot "F:/xxx" Custom

ServerName xxx.com Custom

Note: Namevirtualhost *:80 statement changed to

Namevirtualhost 127.0.0.1:80

Namevirtualhost 127.0.0.2:80

Finally in the Hosts file will be IP binding domain name, the success of the Win7 system to build PHP environment ~

http://www.bkjia.com/PHPjc/996046.html www.bkjia.com true http://www.bkjia.com/PHPjc/996046.html techarticle Win7 PHP Environment Construction Tutorial: Win7 under the PHP environment to build steps to explain today's green tea small tape to everyone is Win7 PHP environment building tutorial, PHP Novice If do not know how to build PHP environment under the 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.