First download the configuration file you want to install
1, apache-2.2.16
2, Php-5.2.14-win32
First, Apache configuration
Apache installation is not said, the installation process to choose the location you want to install, all the way next, you can. The default 80 port, after the installation, the browser input http://localhost/to verify, the success will output it works!
APACHE configuration: The configuration file is located in the%apache_home%\conf\httpd.conf under the installation directory, modifying the root directory DocumentRoot (altogether two). The port is also modified here.
Second, PHP configuration
Unzip the php-5.2.14-win32.zip of the downloaded good. Note that you do not download the debug or None-thread-safe version of PHP. Otherwise, there will be an error when combined with Apache.
Copy the extracted php.ini-dist to make a backup, then rename the original php.ini-dist to php.ini, open the file and configure it.
1. Set the extension location:extension_dir = "%php_home%/ext" (Enable this setting after modification to remove the preceding semicolon,%php_home% for the PHP extract directory)
2. Open the extension that you want to use: extension=php_bz2.dll,extension=php_gd2.dll,extension=php_mysql.dll,extension=php_ Remove the semicolon in front of the mysqli.dll (note that there are no spaces in front) and, if you want to open other extensions, remove the semicolon before the other extensions.
3. Jet lag problem: find
;d Ate.timezone =
Amended to
Date.timezone = PRC
4. Set to combine with Apache
Open the Apache configuration file httpd.conf,
#LoadModule Vhost_alias_module modules/mod_vhost_alias.so
Enter the following line:
LoadModule Php5_module E:/php/php-5.2.14-win32/php5apache2_2.dll
Phpinidir "E:/php/php-5.2.14-win32"
AddType application/x-httpd-php. php. phtml
Explain:
First behavior PHP and Apache combine the dynamic link library location, which is in the root directory after the extracted PHP.
The path of the second behavior php.ini file
The third line tells the browser to send the. php.phtml file to Apache for resolution.
Restart Apache so it can be associated with PHP. (Note that you restart Apache every time you modify your Apache or PHP configuration file)
Should be encountered garbled problems, when encountered in the continued replenishment.
PS: I really encountered garbled, I used the eclipse for PHP developers Development. In preferences, the workspace encoding defaults to Utf-8, but when PHP or HTML pages are not included <meta http-equiv= "Content-type" content=; Charset=utf-8 "", then there will be Chinese garbled. Look at the code of garbled files is already utf-8, must be saved again for Utf-8, garbled before disappearing, should be the BOM (Byte order Mark) problem. The current solution: Open the php.ini file, query keywords: "default_charset", remove the preceding semicolon, modify the value to Utf-8, restart Apache.
Current 1/2 page
12 Next read the full text