PHP Installation Tutorial 1 - Installing WAMP! - Page 3 of 5
Install Apache Web Server
Run the Apache installer, and follow all on screen instructions. As you are setting this up for development and testing, the Network Domain and Server Name will both be ‘localhost’ (No quote marks). For the contact address enter any email address you want, it’s not really important on a develop/test server. Make sure Apache is installed as a service.
Test Apache Web Server
Open your web browser, and navigate to the address ’localhost’ (or http://localhost/). You should see a lovely page telling you apache has been set up and is working correctly, but no pages have yet been added. If you want to at this stage you may add any html pages you want. If you installed with the default paths, go to the directory ‘C:\Program Files\Apache Group\Apache2\htdocs’, this is where any pages you want to make available are kept. Feel free to delete all the pages that start with index and add your own index.html. index.html will be the first page you see when you go to http://localhost/, try it out, add your own! Congratulations your web server is up and running!
Install MySQL
Next we will be installing MySQL, a free database program. This will be necessary for almost all php scripts beyond very basic scripts. Create a temporary directory, on the desktop is a good place; we will be getting rid of it soon anyway. Extract the MySQL zip file to the temp directory and run the setup exe. Follow all the onscreen instructions. Once the setup program has finished and installed MySQL, Delete the temporary directory.
Click 'Start > Run' and type cmd in the box, click Ok. This will open a console window (or MS-Dos box). In the console window enter the following commands and check you receive the correct response:
Enter: cd c:\mysql\bin Enter: mysqld-max-nt --install Response: Service successfully installed. Enter: net start MySql Response: The MySql service is starting. Response: The MySql service was started successfully.
Congratulations you have installed MySQL, however before we are done here we are going to make MySQL more secure by adding a password so only you can change the databases.
At the console window type the following commands (replace new_password with your new password!):
Enter: cd c:\mysql\bin
Enter: mysql -u root mysql
Response: Welcome to the MySQL monitor .....
Enter: UPDATE user SET Password=PASSWORD('new_password')
Enter: WHERE user='root';
Response: OK...
Enter: FLUSH PRIVILEGES;
Response: OK...
Enter: DELETE FROM user WHERE user='';
Response: OK...
Enter: DELETE FROM user WHERE Host='%';
response: OK...
Enter: DELETE FROM db WHERE User='';
Response: OK...
Enter: DELETE FROM db WHERE Host='%';
Response: OK...
Enter: exit
Response: Bye
Enter: exit
Response: Console window closes.
