How to setup Apache and PHP on Windows 2000/XP
Note: %SystemRoot% is usually c:\winnt for Windows NT/2000 and c:\windows for 95/98/Me/XP
1) Create a directory which will be your root directory. In this example, we will use c:\webroot. This will be the default directory when users go to your domain.
2) Download the latest Apache 1.3 release from http://httpd.apache.org. PHP support for Apache 2.0 is still in its experimental stages, so we are going with version 1.3.
3) Download the latest stable version of PHP from http://www.php.net/downloads.php. Make sure you download the ZIP PACKAGE, DO NOT download the installer!
4) Run the Apache 1.3 installer. Make sure you select 'Run as a service' if you want Apache to start up automatically when your computer boots up. Consult the screenshots below if some of the installation prompts do not make sense.
5) Create the directory c:\php.
6) Extract the contents of the PHP zip file to c:\php.
7) Copy c:\php\php4ts.dll to your %SystemRoot%\System32 directory.
8) Copy c:\php\php.ini-recommended to %SystemRoot%\php.ini.
9) Open %SystemRoot%\php.ini with a text editor.
10) Look for extension_dir = "./" and change it to extension_dir = "c:\php\extensions".
11) By default, you do not need to load any other extensions, but if you eventually want to start generating graphics, I suggest you uncomment ;extension=php_gd2.dll by removing the semicolon.
12) Start > Programs > Apache HTTP Server > Configure Apache HTTP Server > Edit the Apache httpd.conf Configuration File. This should open your default text editor, usually notepad.
13) Look for the block of data where you see many LoadModule statements, and add LoadModule php4_module c:/php/sapi/php4apache.dll.
14) Find the block of data where you see many AddModule statements, and add AddModule mod_php4.c.
15) Search for AddType application/x-tar.tgz and add AddType application/x-httpd-php.php on the following line.
16) Look for DocumentRoot, it is probably set to DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs", change it to c:\webroot or whatever directory you created in step 1.
17) Look for DirectoryIndex index.html and add index.php to the end of the line. It should say DirectoryIndex index.html index.php.
17) Restart the Apache service by going to Start > Programs > Apache HTTP Server > Control Apache > Restart.
18) Test your setup by creating a file named index.php in c:\webroot, name it index.php, and add the following line with notepad:
19) Go to http://localhost and you should see a page with information about your PHP configuration.
Note: %SystemRoot% is usually c:\winnt for Windows NT/2000 and c:\windows for 95/98/Me/XP
1) Create a directory which will be your root directory. In this example, we will use c:\webroot. This will be the default directory when users go to your domain.
2) Download the latest Apache 1.3 release from http://httpd.apache.org. PHP support for Apache 2.0 is still in its experimental stages, so we are going with version 1.3.
3) Download the latest stable version of PHP from http://www.php.net/downloads.php. Make sure you download the ZIP PACKAGE, DO NOT download the installer!
4) Run the Apache 1.3 installer. Make sure you select 'Run as a service' if you want Apache to start up automatically when your computer boots up. Consult the screenshots below if some of the installation prompts do not make sense.
5) Create the directory c:\php.
6) Extract the contents of the PHP zip file to c:\php.
7) Copy c:\php\php4ts.dll to your %SystemRoot%\System32 directory.
8) Copy c:\php\php.ini-recommended to %SystemRoot%\php.ini.
9) Open %SystemRoot%\php.ini with a text editor.
10) Look for extension_dir = "./" and change it to extension_dir = "c:\php\extensions".
11) By default, you do not need to load any other extensions, but if you eventually want to start generating graphics, I suggest you uncomment ;extension=php_gd2.dll by removing the semicolon.
12) Start > Programs > Apache HTTP Server > Configure Apache HTTP Server > Edit the Apache httpd.conf Configuration File. This should open your default text editor, usually notepad.
13) Look for the block of data where you see many LoadModule statements, and add LoadModule php4_module c:/php/sapi/php4apache.dll.
14) Find the block of data where you see many AddModule statements, and add AddModule mod_php4.c.
15) Search for AddType application/x-tar.tgz and add AddType application/x-httpd-php.php on the following line.
16) Look for DocumentRoot, it is probably set to DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs", change it to c:\webroot or whatever directory you created in step 1.
17) Look for DirectoryIndex index.html and add index.php to the end of the line. It should say DirectoryIndex index.html index.php.
17) Restart the Apache service by going to Start > Programs > Apache HTTP Server > Control Apache > Restart.
18) Test your setup by creating a file named index.php in c:\webroot, name it index.php, and add the following line with notepad:
Code:
<?
 phpinfo();
?>
19) Go to http://localhost and you should see a page with information about your PHP configuration.