Just follow the instructions below and you'll be fine.... if you just follow....
Install PHP5
1.In Windows Explorer, go to c:\downloads\php5 and unzip the file php-5.0.2-Win32.zip into the directory called C:\download\php5\php-5.0.2-Win32.( in short unzip it to somewhere)
2.You now want to MOVE all the unzipped PHP5 files and directories to c:\php. So in Windows Explorer, go to C:\download\php5\php-5.0.2-Win32\ and press CTRL-A to select all the files, then press CTRL-X to copy them. Now create a directory called c:\php and copy all the files into that directory by going to it and pressing CTRL-V. If you have completed this step correctly, you will see in the c:\php directory four folders and over 20 files.
3.Now move (don't just copy) the file c:\php\php5ts.dll to c:\windows\php5ts.dll (or if you don't have a c:\windows directory, move it to c:\winnt).
4.PHP5 is now installed on your computer, but you still need to configure it to work with Apache, which we will do in the next step.
Configure PHP5 to Work with Apache
1.With the Windows Explorer, create the folder c:\webs\test. This will be our test website.
2.Rename the c:\php\php.ini-dist to c:\php\php.ini, then make the following changes in the c:\php\php.ini file: (1) doc_root = 'c:\webs\test' and (2) extension_dir = 'C:\php\ext'. Note that you should use BACKSLASHES in the php.ini file.
3.In the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the DocumentRoot entry to: DocumentRoot 'C:/webs/test'. Note that you should use FORWARD SLASHES in the http.conf file.
4.Also in the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the Directory entry to: <Directory 'C:/webs/test'>.Note that you should use FORWARD SLASHES in the http.conf file.
5.Again in the C:\Program Files\Apache Group\Apache2\conf\httpd.conf file, add the following lines: hint: to find this position fast, search for 'media types'
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
ScriptAlias /php/ 'c:/php/'
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php '/php/php-cgi.exe'
SetEnv PHPRC 'c:/php'
6.Lastly, we need to make one last change to this C:\Program Files\Apache Group\Apache2\conf\httpd.conf file. Find the 'DirectoryIndex' entry and add 'index.php' to the end of the line as shown in this screenshot.
*you can copy this text: DirectoryIndex index.html index.html.var index.php5
7.In order for the changes to take effect, you need to restart Apache. To do this, click the Apache symbol in the lower right-hand corner of your task bar. In the little menu that pops up there, click Apache 2 and then Restart.
Test PHP5
1.Create the file c:\webs\test\index.php5 with the following line:Today is <? print strftime('%m/%d/%Y'); ?>
2.With your browser, go to
http://localhost. If you see the current date on your screen as in this screenshot, then PHP5 has been successfully installed and configured with Apache.
Set up PHP to work with MySQL 4.1
1.First of all, check the c:\php directory and make sure that the files libmysqli.dll and php_mysqli.dll are both there. If they are not there, check the c:\php\ext directory and copy the files into c:\php
2.Then open up the file c:\php\php.ini in your editor and ADD the line extension=php_mysqli.dll.
3.In order for the changes to take effect, you need to restart Apache. To do this, click the Apache symbol in the lower right-hand corner of your task bar. In the little menu that pops up there, click Apache 2 and then Restart.
4.After about 10 seconds, your PHP will be ready to accept mysqli commands to talk to the MySQL 4.1 database.
Test PHP5/MySQL in browser
1.Create a file c:\webs\test\testmysql41.php and paste in the following code:
<?
$mysqli = new mysqli('localhost','root','admin');
$mysqli->select_db('demo');
$result = $mysqli->query('SELECT * FROM members');
while($row = $result->fetch_assoc()) {
print $row['firstName'] . ' ' . $row['lastName'] . '<br/>';
}
2.In your browser, go to
http://localhost/te..ql41.php.
3.if you see something that contains ur database, then it worked.
4.If you get the message 'Fatal error: Class 'mysqli' not found in C:\webs\test\nameofphp.php on line 3' or something similar then open ur 'php.ini' file and look for ';extension=php_mysqli.dll' then please REMOVE the ';' in that line.