Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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
    
apple.stackexchange.com/questions/23751/… possible duplicate –  rubixibuc Feb 17 '12 at 0:32
add comment

2 Answers 2

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
add comment

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 mysql.com 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
add comment

Your Answer

 
discard

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.