Green tea today to bring everyone is a win7 PHP environment to build a course, PHP novice If you do not know how to build the Win7 under the PHP environment, then the next article can help you, the steps are very detailed OH ~
Here are some caveats:
One, Apache choose MSI format download, all the way Next,ok, modify httpd.conf to configure;
Second, configure the LoadModule php5_module path must be set correctly, and pay attention to double quotes as English characters;
Three, the PHP configuration according to the reference modification can, generally no big problem;
Four, the configuration completes Apache cannot start the error: The requested operation has failed;
V. Error correction methods,win+r-->cmd--> into the Bin folder in the Apache installation directory, enter: Httpd.exe-w-n "Apache2.2"-K start to find the cause of the error;
Six, the possible cause of error is probably grouped into 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 said with OpenSSL module, the use of OpenSSL can be configured to Apache SSL security links);
2, PHP (PHP version: PHP-WIN32-VC6-X86,VC9 is specifically for IIS customization, VC6 is for other Web services software provided, such as Apache).
Second, the Environment configuration
1, configure the site root directory
After the Apache installation is successful, the page in the browser input 127.0.0.1 or locahost will prompt it works! this prompt is under the Apache installation directory (htdocsindex.html), indicating that Htdocs is the site default root directory. Locate the confhttpd.conf configuration file under the Apache installation directory, open the Find documentroot default path, and set the default path (that is, the path to the Htdocs file) as the Web site and directory.
2. Load PHP module and set 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 php.ini as a php configuration file.
Open the confhttpd.conf file under 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"
#以上是我自己的路径, 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
In addition, Ifmodule Dir_module will need to be found to replace DirectoryIndex index.html with DirectoryIndex index.php Index.html, finally test whether PHP is configured successfully, create a new index.php file in the root directory of the 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 Confhttpd.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)
ServerName static.tianxia.taobao.com (Specify access address)
DocumentRoot "F:/xxx" customization
ServerName xxx.com Customization
Note: The Namevirtualhost *:80 statement does not change
Virtual host based on IP address
DocumentRoot "F:/project" customization
ServerName yjh.com Customization
DocumentRoot "F:/xxx" customization
ServerName xxx.com Customization
Note: Namevirtualhost *:80 statement changed to
Namevirtualhost 127.0.0.1:80
Namevirtualhost 127.0.0.2:80
Finally in the Hosts file in the IP binding domain name, the success of the Win7 system to build PHP environment slightly ~