This post will guide you through the steps that are needed to setup your computer as a webserver in order to run PHP. After all, without running PHP, you won’t be able to use AMFPHP since it is the language it is written in.
The tools needed are:
– an operating system (Windows in my case)
– a webserver (IIS or Apache for instance)
– PHP (duh!)
– a database system (MySql, probably the most used with PHP)
The setup I use is also called a WAMP setup. WAMP stands for Windows, Apache, MySql and PHP. Note that a LAMP setup (Linux, Apache, MySql and PHP) is probably more used, but WAMP just better suits my needs.
You can start downloading all of the above mentioned tools and then spend a couple of hours (if this is your first time) installing and configuring them untill it drives you nuts and it still doesn’t work. Or, you can download WampServer and let the dirty work be done for you. Get WAMPServer here.
I tried to make as much screenshots as possible that show all the different steps, so this installation should be peanuts for you.
1. Wamp installation welcome screen (screenshot)
2. License agreement (screenshot)
3. Where should WAMP be installed? I left this at the default location. (screenshot)
4. Start menu folder. (screenshot)
5. Start WAMP on startup? Whatever you like best. I checked it because I needed to work with it for the coming 2 weeks and just to make sure everything was running. (screenshot)
6. Settings overview before installation. (screenshot)
7. Select your webroot folder (screenshot). This is the default but I prefer not to have any workfiles on the same drive as my Operating System in case I needed to format. Therefor I change the location to my D-drive. (screenshot)
8. Warning because I changed the webroot folder. You might not get this screen when you stick to the default location. (screenshot)
9. Select you default browser. Click OK to use Internet Explorer (screenshot), or browse to the FireFox executable. (screenshot)
10. Setup done. Let’s launch WAMPServer. (screenshot)
After the installation
11. If everything went alright, you should see a new icon in your systemtray. This indicates that WAMP is or is not running and provides some menu options. (screenshot)
12. Test it. Click the tray menu and choose the “localhost” option or open up your browser and point it to http://locahost. You should see a file overview of the files in your webroot. This folder may be blank if you chose another folder than the default webroot folder. (screenshot) If you did choose the default webroot folder you should see the WAMP startscreen. (screenshot)
13. In case you didn’t see the WAMP startscreen, copy the files in the default webroot location to the folder you chose as a webroot. (screenshot)
14. Click the PHPMyAdmin link under Tools on the WAMP startscreen to check if MySql is running. (screenshot) PHPMyAdmin is a webinterface to control your MySql databases.
Where’s my IIS startscreen on http://localhost?
IIS users (who run ASP for instance) probably noticed that http://localhost normally pointed to the startscreen of IIS. So how can I access my ASP and PHP webapplications on localhost? Simple, you can’t. At least not when you are running WAMP without having modified the configuration.
OK, so do I have to shutdown WAMPServer if I want to work on an ASP application and start it again to work on a PHP application? The answer is no! Fortunately there is a way to run both webservers at the same time. All you need to do is change the port number the webserver is running on.
When you type in http://localhost in your browser, it is interpreted as http://localhost:80 by the browser because port 80 is the default http port. A port is just an indication to the computer to start a specific process. By default, on my system, it runs IIS. We will leave port 80 as it is and change WAMP to run on port 81.
17. Click the WAMP systemtray icon and choose “httpd.conf” under “Config files”.
18. Do a search for “port 80″ in the config file. (screenshot)
19. Change it to “port 81″. (screenshot)
20. Restart WAMPServer. (screenshot)
21. Click the “Localhost” option in the WAMP systemtray menu.
22. FireFox opens but you get a security warning. It is trying to open the IIS startscreen. (screenshot) Internet Explorer will show the startscreen without the warning as shown before. The point of this step is to notice that the port 81 we specified in the config isn’t shown in the browser’s url bar. We need to change the links on the menu options in the WAMPServer systemtray menu.
23. Open the “wampserver.ini” file in the WAMP installation directory. (screenshot)
24. Scroll down to the “Menu.left” settings. (screenshot)
25. Notice that the parameters show http://localhost and not http://localhost:81.
26. Change the settings to point to port 81. (screenshot) You need to do this 3 times. Once for the “localhost” menuitem, once for the “phpMyAdmin” menuitem and once for the “SQLiteManager” menuitem.
27. Exit WAMPServer. (screenshot) Make sure you completely shut down the tool!
28. Start WAMPServer. (screenshot)
29. Click the “localhost” option in the WAMPServer systemtray menu. It should point to http://localhost:81. (screenshot)
30. Open another browser window (Internet Explorer) and point it to http://localhost or http://localhost:80. The IIS startscreen should open. (screenshot)
Now both the IIS and the Apache webserver are running simultaneously. Once this is done, you can start installing and configuring AMFPHP.
Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner