Download and configure PHPDownload Php:http://windows.php.net/download/php-5.4.16-win32-vc9-x86.zip Download apache:http://httpd.apache.org/ Download.cgi#apache22
First, copy all the DLL files within the PHP5 (including the DLL files in the Ext folder) to the System32 folder of the WINDOWS system, such as C:windows\system32. This step is for the Windows system to get the DLL files that are running PHP, the meaning of the same as the specified system environment variables, just for the sake of simplicity, and copy the DLL files directly to the Windows system directory.
Second, renamed "Php.ini-development" to "php.ini". PHP.ini is a file that records PHP configuration information. Use the editor to open the php.ini, which is configured in the following format:
; Extension=php_bz2.dll
preceded by ";" Indicates that the configuration is invalid, so we want to put the ";" in front of the configuration item we need The number is removed:
Extension=php_curl.dllextension=php_gd2.dllextension=php_mysql.dllextension=php_pdo.dllextension=php_pdo_ Mysql.dllextension=php_pdo_sqlite.dll
Like Extension=php_gd2.dll, let PHP turn on support for the GD2 picture library. These are the more commonly used configurations, which are supported by most hosts.
Third, set the extension support directory
If you follow the above settings, the system still prompts not to support extension modules, such as MySQL is not supported, then you can manually set the extension directory in the php.ini file:
Extension_dir = "E:/php/ext"
First, support PHP parsing:
Modify the httpd.conf under Apache installation directory conf, and within LoadModule, append (or change to) the following configuration:
LoadModule php5_module "D:/program files/php-5.4.8-win32-vc9-x86/php5apache2_2.dll" Phpinidir "D:/Program Files/ Php-5.4.8-win32-vc9-x86 "AddType application/x-httpd-php. php
Second, change the default parsing directory:
Search for the keyword "# documentroot" section, join (or change to) the following configuration:
DocumentRoot "E:/html"
Not far below, there is such a line: # This should is changed to whatever you set DocumentRoot to
Change the <directory "c:/***" > to the corresponding directory configuration:
<directory "E:/html" >
Note: Depending on your situation, you can change the parse path of Apache to point to your actual parsing path.
After you have configured the above two points, start the Apache Web service or restart the Apache Web service for the configuration to take effect by tapping the options in Apache HTTP Server 2.2.22, Start-to-program.
Test PHP Support
Open the editor, create a new PHP file, and type the following code:
<?php phpinfo ();? >
Save the file in the E:/html folder and name it phpinfo.php. In the browser address bar type: http://127.0.0.1/phpinfo.php access to the file, the browser page should be the PHP system information.
Virtual Host
Modify C:\Windows\System32\drivers\etc\hosts Join 127.0.0.1 test.local.com
To modify the httpd.conf under Apache installation directory conf, search for the "# Virtual hosts" section and add (or change to) the following configuration:
<directory/> Options followsymlinks allowoverride None Order allow,deny allow from all</ Directory>
Include conf/extra/httpd-vhosts.conf
Modify Httpd-vhosts.conf, join
<virtualhost *:80> documentroot c:/dev/svn/phpinfo ServerName test.local.com</virtualhost>
In the browser address bar type: http://test.local.com/phpinfo.php access to the file, the browser page should be the PHP system information.
SOURCE http://www.cnblogs.com/ggjucheng/p/3348536.html
apache+php installation and configuration under Windows