I got the answer for this and all is well now.
This usually means that you have the Apple version of the Apache Web Server already running.
Apple provides a version of the Apache Web Server with OS X. I chose to use XAMPP because it includes PHP and the MySQL server all in one package.
You cannot install XAMPP with Apache already running on your Mac. If you see "It works!" when you open your browser and type "localhost" into the address bar, this means that the Apple version of Apache is already running. You cannot run two instances of a web server at once, so the Apple Apache must be stopped before you can install XAMPP.
In OSX 10.7 and earlier, you could start and stop the Apache Web Server in Control Panel, by choosing "Sharing" and then unchecking the "Web Sharing" checkbox. As of 10.8 this option is no longer in the control panel.
To disable Apple's version of Apache in current versions of OS X, open a Terminal window and type this command:
sudo apachectl stop
You will need to type your system password when prompted, then you should be able to start the XAMPP version of Apache.