Part 1 - GETTING STARTED - Page 2
Locate the file C:\Apache\conf\httpd.conf and open it with Notepad or WordPad. Find the line AddModule mod_setenvif.c
Add the following 3 lines:
LoadModule php5_module c:/php/php5apache.dll
AddType application/x-httpd-php .php .phtml
Save the file.
Open C:\Windows\php.ini with Notepad
Locate [mail function]
My outgoing mail is smtp.ntlworld.com and my email is firstname.lastname@example.org so my php.ini file reads:
; For Win32 only.
SMTP = smtp.ntlworld.com
Smtp_port = 25
; For Win32 only.
sendmail_from = email@example.com
Locate doc_root and change the line to read:
doc_root = "C:\Apache\htdocs"
Locate extension_dir and change it to read:
extension_dir = "C:\php\ext"
Locate the list of extensions and change the appropriate one to read:
Notice that the semicolon has been removed from the beginning of these lines!
This is very important to get right. After installing MySql, restart the computer and wait for the following program to run:
This program will be the 2nd window to open, the 1st window is mysqld-opt.exe. Eventually a 3rd window will appear, asking you for a user name and password. The data that you enter is stored in a file:
If everything has gone correctly, you should see a 'Traffic Light' icon in the right hand start menu. A green light means MySql has started, red means it hasn't. The next time you run the computer, MySql should automatically start, and you should get the green light.
After downloading a virus, I had to reinstall MySql. However, I couldn't get the program to work again! Eventually, I decided to delete the my.ini file. This did the trick, because MySql uses my.ini during start up. So I can only assume that it was configured incorrectly. I entered the user name and password again, and it seems to be working correctly.
This folder already exists, and is located at:
C:\Apache\htdocs, where the server looks for your PHP files. This was set when you configured php.ini
You could change that but please make sure you know what you're doing. Otherwise, just put all the PHP files in the htdocs folder.
For example, the file below is: C:\Apache\htdocs\phpinfo.php but to run it, you type: http://localhost/phpinfo.php You don't have to tell it to look in 'htdocs' because php.ini tells the server where to look.
Type the following code into notepad, and save as C:\Apache\htdocs\mysqltest.php
$connection = mysql_connect( "localhost", "root", "" )
or die( "Unable to connect to MySQL" );
echo( "Connected to MySQL ok" );
Now type http://localhost/mysqltest.php and you should see, "Connected to MySQL ok".