Thursday, June 9, 2011

Setting up PHP on Windows XP Pro

Finally, I decided to start working on some side internet projects. First step is to setup a PHP web server as most of the free hosting webstite support PHP and MySQL. While searching over the internet and speaking with a co-worker, I came across a freeware, XAMPP. Since my primary focus is to start with zero cost, I have decided to implement XAMPP.

After downloading XAMPP, I begin the installation process. The installation process seems fairly smooth. However, when installation is completed, there is notification indicating port 80 is used by another application.
To determine which application is using port 80, I typed netstat -no in the command line application in Windows XP. After identifying the PID, I opened Task Manager to search for the application based on the PID. Typical Task Manager does not display the PID. In this situation, click on View and select Column. In the column selection, check PID.

Quickly TimeViewer, which is a freeware for controlling the Windows desktop remotely, was identified as the application that was using port 80. Again, with another quick search online, steps were found to change the timeviewer port from 80 to an alternative port.

1. Open port 5938 (TCP) on your firewall.
2. Change the following registry keys.
* [HKEY_LOCAL_MACHINE\SOFTWARE\TeamViewer\Version4]GatewayAllowed set to 0
* [HKEY_LOCAL_MACHINE\SOFTWARE\TeamViewer\Version4]ListenHttp set to 0
Changing the registry is easy by entering regedit in the run box

After port 80 is now freed, Apache can then be started. Once Apache is started, I can access the site using the URL, localhost. To allow accessing of the webserver remotely, first I need to change the httpd-xampp.conf file located under xampp\apache\conf\extra directory. Towards the end of the file, a # sign is put in from of the phrase Deny from all. If there are a set of specific IPs which are allow to access the webserver, then individual IP is noted in the config file. If is allowing all access, then Allow from all is added to the documentation.

After saving the file and restarted, now the webserver can be accessed by typing the IP address of the webserver. Firewall will need to be disabled or properly set up for the remote system to access the webserver.

Final step of my web set up is installing a mediawiki. The process is very simple and can be found on MediaWiki website. The intention is to use MediaWiki to track any additional projects I want to implement.