Archive for 1. Installation, Getting Started

Do you get a socket address or port 80 error when you try and run the Web server?

If you get an error that refers to a socket address,or port 80, these indicate that xampp can’t start because port 80 is already in use. This means that you are running other piece of software that is already using port 80. The most likely candidates are Skype or another Web server such as MS IIS or Cold Fusion server.

SOLUTION 1: Exit the program that is causing the conflict, start xammp again and it should run with no problem. For SKYPE, see SOLUTION 2 below. If you are running another Web server or can’t determine what program is causing the conflict, SOLUTION 3 below may be simplest for you.

SOLUTION 2 (IF YOU USE SKYPE): Skype does not actually need port 80 but will use it if it’s available. So if Skype is running BEFORE you start xampp you will get an error. But if you run Skype AFTER starting xamppp, both programs should run OK.  Alternatively you can tell Skype not to use Port 80, as follows.

Depending on your version of Skype. either:

(a) Go to File-> Options -> Connection or

(b) Go to Tools->Options->Connection

Now Uncheck Use Port 80 as an alternative for incoming connections. You may need to restart Skype after doing this. You should now be able to run xamppp with no problem.

SOLUTION 3: If you cannot determine which software is causing the conflict, OR if you want to run both programs, you can tell xampp to listen to port 8080 (the alternative for port 80). IMPORTANT: Once you make the change to accomplish this you will need to restart xampp, and use http://localhost:8080/ in the address window instead of just http://localhost/. Here are the changes to use port 8080:

Start a text editor and choose Open File. Browse to your xammplite folder location and open xampplite\apache\conf\httpd.conf. You will make TWO changes:

  1. Somewhere around line 53 (or just search for this), you will find the line: Listen 80 Change this to: Listen 8080 (NOTE: do not change the lines that begin with # – these are comments and will not effect the configuration)
  2. Somewhere around line 169 (or just search for this), you will find the line: ServerName localhost:80 Change this to: ServerName localhost:8080 (NOTE: do not change the lines that begin with # – these are comments and will not effect the configuration)
  3. Save the file. Start xampp. It should now run with no problem but your URL must always begin with http://localhost:8080/ instead of http://localhost/

Leave a Comment

Installing on Vista

The default Vista installation contains missing or insufficient write permissions in the c:\program files folder. For this reason, when you install xampplite in Vista,  choose a different folder location, for example c:\xampplite or c:\myfolder\xampplite.

You may prefer to install on a portable drive that you can then attach to any computer.  If you do that,  each time that you change computers, you will need to run the setup_xampp program (see Chapter 2)  before you run the Web server. That’s because your drive was probably assigned to a different drive letter and the setup progam will reset the path to the correct drive letter (and if the drive letter happens to be the same you will just see the message “Nothing to do”).

Leave a Comment

Do you get an error: “Application failed to initialize properly (0xc015002)”?

When you start your Web server (apache_start) do you get a message “The application failed to initialize properly (0xc015002)”?   Some distributions of Windows XP do not include the program that handles applications developed in C++. Here is the link to Microsoft’s site obtain this program.

You can just save and run this to install it and your xampp installation should then work (you should not need to reinstall xampp).

Leave a Comment

“Error on Line 42” message when you start xampp?

If you run apache_start.bat  and get the message: Apache 2 is starting … but you then see somethng like this:

apache.exe: Syntax error on line 42 of C:/webServer/xampplite/apache/conf/httpd.conf: ServerRoot must be a valid directory

This means that you must run setup_xampp before you run apache_start – see page 32 in the textbook. Once you have done this you should be able to start the server with no problem. NOTE: Usually you only to do this first time you install xampp, but if you installed on a USB or other portable drive, you will need to run setup_xampp each time you change computers because Windows assigns a different drive letter to the USB drive. It never hurts to run setup_xampp – if you get the message “Nothng to do” it just means that it wasn’t necessary.

Leave a Comment

Are you have trouble understanding how to use your Web server?

When you use xampp, you are connecting to a Web server that is located on your own computer rather than somewhere else in the world. Just as other Web servers have domain names (for example your local Webserver has a domain name: http://localhost. The procedure to use your Web server is as follows:

First, like any Web server, the server must be running so that you can connect to it. To run the server, double click the apache_start program in your xampplite folder. You will see a DOS (Console) window with the mesage that Apache 2 is starting..). That means your server is now running (don’t close this window – you can minimize it).

Now you can connect to your server and open Web page, and run PHP programs. To do this open a Web browser (Firefox, Internet Explorer, Safari, Chrome, Opera. etc). Type the URL tof the file you want to open (this is also described in detail in Chapter 2).

Let’s start with something in the samples folder, for example welcome.html. The samples folder is located in the xampplite/htdocs/webtech folder. The URL to this folder is http://localhost/Webtech so the URL to welcome.html is
http://localhost/Webtech/samples/welcome.html If you type this address you will see the welcome document displayed in your browser window.

Similarly your coursework folder is located in the xampplite/htdocs/coursework/webtech folder. The URL to this folder is http://localhost/Webtech so the URL to myFirst.html in you chapter02 folder is http://localhost/Webtech/coursework/chapter02/myFirst.html

Do you see the connection between the actual location of each file and the URL? The actual location is in some folder inside the htdocs/Webtech folder. So when you want to edit your files ina text editor, you will
open and save files in locations under this folder. The URL to these files begins with http://localhost/Webtech followed by the folder names and file. Use the URL to view these files in your Web browser.

If you get a message Object not Found or something similar, it means that you did not type the correct URL, or you did not place your file in the correct location.

If you connect to a PHP file and see the PHP code instead of the results, it means you are opening your files using Windows Explorer instead of typing the URL to the Web server in your Web browser’s address box. You
must open your HTML and PHP files using the URL, begining with http://localhost/Webtech

Note: If you are using a Mac or Linux computer, you must first install the Webtech folder – instructions are provided to do this on the CD and Web site.

Leave a Comment

My browser displays PHP code instead or runnning the program!

That’s because you’re not using a URL to connect to the PHP file. Most likely you are opening your HTML or PHP files by double-clicking them in Windows Explorer. When you do that, the HTML file looks fine but the PHP shows the actual code instead of running. And that’s because you are not using the Web server (even though you may have started the server). To connect to the server you can’t open the .html file in Windows Explorer, you must open the file as a URL in your browser so that the browser will then call the server.

You always know whether you are using the server by looking in the address window in your browser. If the address begins with http://localhost then you are using the server. If it begins with the word file:// followed by a drive letter and file path then you are not using the server..

So .. to do this correctly, don’t double click the file in Windows Explorer. Instead start your Web browser if it’s not already running and type the URL in the address window, for example:


If you get a Not Found message, that’s because you didn’t start your Web server first 🙂

Leave a Comment