Grow your CSS skills. Land your dream job.

Testing local server with MAMP/wordpress on external device?

  • # May 4, 2013 at 4:21 pm

    Hi guys

    I am currently developing a wordpress site locally using MAMP PRO.

    I would like to test this site on my iPhone but am not sure how to configure my mobile device to talk to the local server.

    Does anyone have any information on how to get this working or point me in the right direction? Do you need another application to do this, or can it be done with mamp/IP address etc?

    Thanks

    # May 4, 2013 at 6:06 pm

    I can’t give you anything specific to MAMP PRO, but I can tell you how I got this working with a localhost/development copy of Apache. This page helped me figure out a way to accomplish this:

    http://www.dd-wrt.com/wiki/index.php/DNSMasq_Local_Network

    What I needed to do was implement the settings within my router’s “DHCP / DNS Server” settings. I had to enable “Use internal DNS” within my router. So, let’s say I had the following Apache VirtualHost’s setup to test some site(s).

    http://mytestsite1
    http://mytestsite2

    I’d have to implement the following within my router’s DHCP/DNS settings:

    address=/mytestsite1/192.168.1.102
    address=/mytestsite2/192.168.1.102

    The IP number at the end would be your local IP address.

    So, if you were to implement something like this and enter the following URL’s in your mobile device:

    http://mytestsite1
    http://mytestsite2

    The router would reroute that to your site in MAMP. Any device with access to your LAN would be able to connect to those addresses as well.

    # May 4, 2013 at 9:37 pm

    You could try using tools such as https://forwardhq.com/ or http://progrium.com/localtunnel/

    # May 5, 2013 at 10:22 am

    Thanks for your responses guys. Some good information there.

    The problem is I can get to the local domain no problems using either the IP address or through the terminal, but I can’t seem to connect to the wordpress database. (at least, this is what I think the problem is)

    I just seem to get the index page (no styling). When I click on another page, it says the page cannot be found.

    Any ideas what this could be? I have tried googling around but cannot find specific information on connecting to a local wordpress installation. Maybe I am not looking in the right places

    # May 5, 2013 at 10:52 am

    Ok got it… http://www.designshifts.com/view-local-wordpress-website-on-your-iphone-or-ipad-with-mamp/

    Turns out it is just simply calling the IP address. Only thing I missed was not putting the IP address as the website URL in the wordpress admin

    # May 5, 2013 at 11:33 am

    I’ve had the same problem seeing my localhost test site on my iphone. All I can get is an unstyled page. In the WordPress General Settings I have:

    WordPress Address (URL) http://localhost:8888
    Site Address (URL) http://xxx.xxx.x.x:8888/wordpress

    The x’s are of course the IP address and “wordpress” the folder housing all the wordpress files. Are your settings different from these?

    # May 5, 2013 at 12:14 pm

    @smcr yes I know what you mean. To get it working I didn’t follow the article exactly.

    In the two wordpress URL’s in admin, enter the following only…

    http://xxx.xxx.x.x

    So only the IP address. Make sure you write that in both boxes. Then navigate to this IP address on your mobile.

    Forget the port at the end, and the name of the host, as this was causing it to fail for me

    # May 5, 2013 at 7:48 pm

    got it, thanks

    # May 7, 2013 at 1:57 am

    It can also be easier to change/troubleshoot by placing the settings in your wp-config file…

    define(‘WP_SITEURL’,’http://your-site-url.com’);
    define(‘WP_HOME’,’http://your-site-url.com’);

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".