Helping ordinary people create extraordinary websites!

Setting Up Apache, PHP & MySQL On Windows

By Amrit Hallan
2004-02-25

Installing PHP
You can download the latest version of PHP (for Apache on Windows) from http://in.php.net/get/php-5.0.0b4-Win32.zip/from/a/mirror

After you have downloaded the file, extract it in a suitable folder. Let the path be c:\php.

You can run PHP for Windows in two ways: - a CGI executable (php.exe) and as an API module. I recommend using the API module and we'll configure PHP that way.

Once you have installed PHP in c:\php, locate a file there named php.ini. Copy this file to WINDOWS or WINNT folder.

If it is not already set, set extension_dir=c:\php in your php.ini file.

Now the part where PHP runs as an API module.

You need to locate two files in c:\php and they are php5apache.dll and php5ts.dll. Make sure these files here in this folder and in the same location.

Remember you installed Apache in c:\Program Files\Apache Group\Apache2? In Apache2 there is a folder "conf" and in this there is a file "httpd.conf". Open this file (I suggest you take a backup of this file before tinkering with it), and add the following lines somewhere:

LoadModule php5_module c:/php/php5apache2.dll
AddType application/x-httpd-php .php

If you want to use a PHP file (index.php) go to the line that contains:
DirectoryIndex index.html index.html.var index.shtml

Add index.php to it such that it appears as DirectoryIndex index.html index.html.var index.shtml index.php

That's it. You are ready to unleash PHP on your computer.



Tutorial pages:
 1 Votes

You might also want to check these out:


Leave a Comment on "Setting Up Apache, PHP & MySQL On Windows"
You must be logged in to post a comment.

Link to This Tutorial Page!


GET OUR NEWSLETTERS