Download Apache2, Official Site: http://www.apache.org
Download PHP 5.0.1, official site: http://www.php.net
First install PHP 5.0.1
1, decompress the PHP to C: / PHP directory
2, rename the php.ini-dest file to php.ini, copy to WinNT (Windows 2000) or Windows Directory, copy PHP5TS.DLL, GDS32.DLL, GDS32.DLL, LIBMYSQL.DLL, LIBMYSQLI.DLL in C: / PHP (If you use mysqli) to copy to the System32 directory
Modify php.ini
Short_open_tag = OFF Allows <% Write in the ASP, Win32 is not allowed by default, disabled, disabled, using, spaced, such as: phpinfo, execdisable_classes = Disabled class error_reporting = e_all display all error messages I am displaying Severe error message, set to e_ERRORDISPLAY_ERRORS = ON default display error message, if you are your own debugger, set to ON, otherwise set to Offerror_Log = "H: /LOG/php5log.txt" If the above is set to not display the error message, You can set the log to record errors
EXTENSION_DIR = "C: / PHP / EXT"
Next, find the most extension, remove the semicolons in front of these lines
EXTENSION = php_gd2.dllextension = php_mysql.dllextension = php_mysqli.dll
Configuring Apache2
After installing Apache, find the conf folder under the Apache directory, open httpd.conf files, edit
Listen 80 listening port
Execute the PHP as the Apache module, find the most place of LoadModule, join
LoadModule PHP5_MODULE C: /PHP/PHP5APACHE2.DLL
turn up
ServerAdmin Webmaster@****.net is set to the administrator's mail address
ServerName www. ****. Net: 80 hostname (domain name, IP address) and port address
DocumentRoot D: / wwwroot / website root directory
DirectoryIndex index.php index.html index.html.var Add to the default document
ServerToKens Full Display server information, full is all, the PROD is the least, it is recommended to set it to the PROD, not easy to expose the server information
AddDefaultCharset GB2312 default character encoding, if Apache does not display Chinese normally, set to GB2312, or UTF8
AddType Application / X-httpd-php .php .phtml .php3 .php4 Add to PHP, PHTML, PHP3, PHP4 file Support AddType Application / X-httpd-php-source .phps provides PHP source code files, putting PHP files The extension is modified to * .phps, directly access the PHP source code virtual host setting:
NameVirtualHost *: 80 listens to all IP addresses 80 ports that are bound to this machine
Typical virtual host settings
After configuring, restart your apache, use http: // localhost to access, if you can see the Apache's default page, your Apache is configured successfully.
Next, write a PHP script to test whether your PHP is normal.
PHP
PHPINFO ();
?>
If you can see your PHP information, congratulations! Your apache and PHP are all fine.