• Resolved Robert Gadon

    (@yogaman5020)


    I’m trying to set up a local development environment on my Mac with MAMP without success. The web site I want to develop is currently hosted by Go Daddy (journeyswithjeffhoag.com). I followed the instructions provided by egalo.com and the WP Codex. In summary, here’s what I did:

    1) Entered ‘Applications/Utilities/Terminal’ and changed the name of the local host to ‘jwjh.com’.

    2) Installed a fresh copy of MAMP (v. 2.2) and configured the Apache port to 80 and the MySQL port to 8889. Set MAMP’s document root to my dedicated local directory for the web site files.

    3) Used an FTP client to copy the hosted site’s web files from the root directory, and transferred them to the dedicated directory.

    4) In MAMP’s phpMyAdmin, created a new MySQL database, and imported a backup of the web site from the host site as a *.sql file.

    5) Opened the ‘wp-config.php’ file, and changed the DB_NAME to reflect the database name used in MAMP. I also changed both the DB_USER and DB_PASSWORD to ‘root’, and left DB_HOST as ‘localhost’.

    6) Per egalo.com’s instructions, I entered MAMP phpMyAdmin, and searched and changed the values in the wp_options table for my test database from the host site’s url to my localhost url (journeyswithjeffhoag.com -> jwjh.com).

    When I tried to view the site locally in my browser, I got a white screen.
    I know this process should work. Earlier today I followed this procedure and was able to view another site in my browser from a local backup. I suspect there’s something up with the files downloaded from Go Daddy. For example, I don’t see a wp-admin/install.php file included with Go Daddy’s host files. [Could it be because of their 1-click install, they put the file somewhere else?]

    I’m not sure what or where to investigate further. Any suggestions?

Viewing 1 replies (of 1 total)
  • Thread Starter Robert Gadon

    (@yogaman5020)

    I solved my problem. Here are my lessons learned, for the benefit of others.

    1) Make sure you have a complete, current copy of WP in your local root directory. This is easily downloaded from the WP.org website. My web host appeared to install WP differently in its domain directory in comparison to WPs’ file structure. That discrepancy between the hosted site’s WP files and the complete WP file structure made it impossible to cleanly load WP locally.

    2) Sources differ on where to place the local installed files of the web site. I eventually went with the directions from MAMP and chose ‘/Applications/MAMP/htdocs.

    3) Two plugins recommended by Mac MacDonald were invaluable in speeding up the local installation; BackUpWordPress (BUWP) and WP Migrate DB (WPMDB). The former zips up and downloads the WP files and MySQL db to your computer, and the latter creates a standalone MySQL db file to install through phpMyAdmin. I used BUWP to migrate the host files, and WPMDB to download a copy of the MySQL db. Incidentally, BUWP cut down on the time to copy and download the hosted files compared with FTP by about an hour.

    4) With a fresh install of WP in the /htdocs directory, I overwrote the wp-content directory there with the files downloaded from the host site using the BUWP plugin.

    5) Per egalo’s instructions, be sure to set up your local domain, and define your localhost (IP address 127.0.0.1) using Terminal (/Applications/Utilities/Terminal) to whatever your local installation url you choose (e.g. change from host site url ‘mysite.com’ to local site url ‘mysitedev.com’).

    6) Very important: After migrating your hosted site’s WP files and db, find and replace all references to your host sites’ url with your local sites’ url. See egalo’s ‘Fixing the WP URLs’ using phpMyAdmin for step-by-step instructions (link in step 5 above).

    7) Use Interconnect/IT’s WordPress safe search and replace tool for correcting serialized data strings in your WP files. You download their software, unzip the file and place it in your WP root directory (in my case, ‘/htdocs’). To run the file, type in your browser address bar: localhost/searchreplacedb2.php (or whatever you renamed their file on your computer). Then follow the prompts. The find and replace function is fast (fractions of a second). As they say over and over, REMOVE and discard the find/replace file from your hard drive when done so no once can make mischief with it if your machine gets hacked.

    8) MAMP was acting wonky on me. While MAMP’s documentation says in ‘Preferences/Start_Stop’ to define the start page url as ‘Applications/MAMP/htdocs’, I received an error message in my browser when I selected that definition. [Note: MAMP’s start page is not the same as the document root defined elsewhere in Preferences for the Apache server.] One user on the MAMP forum found that using ‘/phpMyAdmin’ as the start page url worked fine. It does. It will just bypass MAMPs landing page and take you directly to phpMyAdmin.

    9) Entering in my browser: ‘localhost/wp-login.php’ took me to WP’s login page for the local WP install. Entering the username and PW from my hosted site generated a ‘404 Not Found’ page and a url in the browser address bar of ‘mylocalurl.com/mylocalurl.com/wp-admin/’. When I change the address bar url to: ‘mylocalurl.com/wp-admin’, my WP administrative dashboard popped up! Not sure why, but that’s where I wanted to go all along. Works for me.

    Problem solved. World saved!

Viewing 1 replies (of 1 total)
  • The topic ‘MAMP – WP won't show locally in browser’ is closed to new replies.