Fix XAMPP HostnameError001 on Mac OS X

Today when starting up XAMPP in Snow Leopard I ran across this problem where I was getting a HostnameError001 popup. So the first thing that I thought of was to cross check my hostname with my computer name. Turns out that for me this was the problem.

Here’s how to check:

Step 1 – Open up Terminal.app and type hostname:

foo:~ larry.gordon$ hostname
foo.local
foo:~ larry.gordon$

For me I gets something like this: foo.local

Step 2 – Now open up System Preferences.app.
Step 3 – Click on Sharing.

At the top you will see Computer Name: with an input field to the right of it. If the computer name differs from the hostname then this is your problem. You can do 1 of 2 things.
1. You can change your computer name to match your hostname.
2. You can change your hostname to match your computer name.

To change your computer name

Step 1 – In System Preferences.appSharing change the Computer Name to match your hostname (exclude the .local as this will automatically be added to your hostname.
Step 2 – Log out or Restart your computer for the changes to take effect.

Change your hostname

Follow one of my previous posts on how to change your hostname Change the hostname in Mac OS X [osx].

Date
April 29, 2011
Time
3:39 pm
Category
Uncategorized
Tags
Tags: , , ,


  • Thanks for this tip. Saved me from needlessly reinstalling XAMPP. As for changing the hostname, I did it this way in OSX Lion Terminal.app: sudo hostname desired.hostname

  • Jon Mitten

    No longer relevant in Mavericks – there’s no web sharing option in the GUI