I develop my web applications on a local server environment using MAMP Pro (MAC) and XAMPP (PC). There are hundreds of reason for developing locally with a PHP/MySQL/Apache environment before jumping onto your live server (speed and security being the big ones). But what if you need to test your applications not only on your desktop browsers but also on your smart phone/iPhone or tablet/iPad? * It’s a bit more complicated then just working online, you need to find a way for your devices to access your local working environment.
Lucky it’s easier then you might think.
*Everything I explain will work for most website installations (not just for WordPress installs, but there’s extra instructions at the end to help smooth out a few things that might frustrate you if you’re using WordPress).
- First make sure you have MAMP installed on your machine.
- Next step is to get your IP address on your MAC > System Preferences > Network > AirPort.
- Now you’ll need the Apache Port from MAMP. (default is 8888).
- Put these two piece of information together to make up the URL for your iPad/iPhone: 192.168.100.170:8888. (This will be your local root directory.) That’s it! If your using WordPress keep reading…
WORDPRESS (If you’ve installed WordPress then you’ll have to do a couple more things):
- First (and always) backup your database before making any major changes to your site.
- Log into your wp-admin go to > Settings > General. You need to change both the > WordPress Address (URL) and the > Site Address (URL) to match the new IP address. So in this example below you can see that I was working in a localhost and now I’m am changing them both. So From http://localhost/example-site to http://192.168.1.29:8888/example-site.
- That should do it! If you have any problems leave me a comment and I’ll see if I can help!