Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to Mac OS X, and I have a MacBook Pro. I am developing a web application with PHP and MySQL. I already installed XAMPP on my Mac. I discovered the option for hosting in System Preferences > Sharing > Web Sharing, but I don't know how to use it or how to tell my friend to view my web application remotely. Can someone help me?

share|improve this question… possible duplicate – rubixibuc Feb 17 '12 at 0:32
up vote 0 down vote accepted

Web Sharing opens port 80 (http) on your machine and points any incoming requests to ~/Sites. You'll want to put your PHP app there for it to work through Web Sharing. I'm not sure if there is any further configuration you have to do on the PHP/MySQL side since I don't know anything about either of those languages. That's probably a question for SuperUser.

As far as accessing it remotely, you'll need to open port 80 on your router and point it to your computer's internal IP address. Then you'll want to give your friend either your domain name or your current IP address from your ISP and have them type it in their web browser.

share|improve this answer

You just tick the box, an then anyone who doesn't get blocked by your firewall can view the site, either by domain name or IP address.

PHP is installed but disabled by default, you need to enable it i httpd.conf (not sure what the exact path is). Just search for PHP and uncomment anything relevant. Any change needs a restart of Apache (untick web sharing, wait, and tick it again).

MySQL isn't installed by default, but has a pkg installer for it, and apple has already configured PHP to connect to it (via root@localhost with no password).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.