Local WordPress and MAMP installation for Mac
The first time I did a local WordPress install with MAMP on my MacBook Pro 15″ laptop with Retina display, it was deceivingly simple and successful. However, the next time I tried to load the url to my local WordPress installation, Google let me know that it was not available! The following is my journey of discovery in troubleshooting my local WordPress and MAMP installation for Mac.
The famous 5 minute WordPress Installation Process for Mac
- Download zip file of all WordPress files from WordPress.org.
Unzip them! The WordPress folder will appear in your download area on your Mac.
- Create an empty wordpress folder within your Sites folder.
Place your downloaded WordPress files in the empty wordpress folder located in your Sites folder mentioned above. The steps to take? Copy all your WordPress files within your downloaded WordPress folder to the empty wordpress folder located within your Sites folder.
- Download and install MAMP for Mac
- Check your Start/Stop MAMP preferences. Check box #1 (start servers), box #3 (open Web Start page) , and box #4 box (stop servers). Leave #2 blank (that’s the “Check for MAMP pro box). Lastly, in the “My Favorite Link” placeholder, type in “/MAMP/”. This will make sure that whenever you initialize MAMP, it takes you to the MAMP download page where you will find the link to phpMyAdmin, where you will create your database and user necessary for completion of your local WordPress install.
- Leave Ports as is. (default). Default ports are: Apache: 8888; Nginx: 7888; MySql: 8889
- Make sure the most recent version of PHP is selected.
- Next, click on the Web Server tab in your MAMP preferences and choose the APACHE server. Then click on the document root icon (symbolized by “…”) and choose the “Sites” folder within your “username home icon”. When you click on the document root icon, your finder will pop up, and you just have to find and select your Sites folder. After you select the Sites folder, it will appear in the Web Server tab. Then click “ok”.
Then go into the MAMP WebStart page and click on the phpMyAdmin link. it will take you to phpMyAdmin where you will create your WordPress database and user to complete your local WordPress installation. Just a note: whenever you quit MAMP, and then re-initialize it, you will be taken to this MAMP Welcome page.
- To the left of “Welcome!” MAMP page, the headers “PHP” and “MySQL” should appear. Under the “PHP” header, you will find “phpinfo shows the current configuration of PHP”. When you click on the “phpinfo” link, it will tell you what version of PHP you are using for your install. It should be the most recent version. Under the “MySQL” header, “MySQL can be administered with phpMyAdmin.” appears.The “phpMyAdmin” link will take you to phpMyAdmin where you will set up your database and user.
When you land on phpMyAdmin, it should look like this:
Keep everything on this page “as is”.
- Click on the Databases tab. Here you are going to create your WordPress database. Within the “Create database” placeholder, type “wordpress”. Within the dropdown menu with Collation (currently) selected, select “utf8_bin”. Then click on the “create” button. Voilà! You’ve created your wordpress database.
- Next, you have to set up the root user for your database. MAMP should do it for you automatically, but in case if that hasn’t happened, do the following:
a. Click on the Users tab. You should see a “root” user. If not, click “Add user” and do the following:
b. Leave the User name set to “Use text field” and enter “root” as the name
c. Set the Host to “Local” in the dropdown menu and leave the value in the placeholder as “localhost”.
d. Leave the Password set to “use text field” and enter “root” as the password.
e. Re-enter the “root” password.
f. Next, go to “Global Privileges” and check “Check All”. Then click on the “Go” button at the bottom.
- Next, go to the location of your new WordPress site in your browser. The location should be http://localhost:8888/wordpress
You should see a screen where you have to select a language. Select your preferred language and click “Continue”. On the next page, click “Let’s go!”.
- On the next page after that (as seen right above), you should be asked to enter your “Database Name”, “User Name”, Password”, “Database Host”, and “Table Prefix”. You should enter the following:
a. Enter “wordpress” for the Database Name (or whatever name you chose in step 13 (when you first created your database in phpMyAdmin).
b. Enter “root” for the User Name (this is what you entered when you “added a user”)
c. Enter “root” for the Password (this is what you entered when you “added a user”)
d. Leave the Database Host as “localhost”
e. Leave the Table Prefix as “wp_”
f. Click Submit!
- On the next page, click “Run the install”.
- Next, you will be directed to your “Welcome” page. It says:
“Welcome to the famous five-minute WordPress installation process! Just fill in the information below and you’ll be on your way to using the most extendable and powerful personal publishing platform in the world.”
Then it goes onto state:
Please provide the following information. Don’t worry, you can always change the settings later.
Site Title: Choose the site title you want to use for the particular wordpress installation
Username: choose a username (admin is typically used, but could prove to be a weak choice, since so much of the world uses it. On the other hand, if you want to add on SSL to your live website later, you might want to use “admin”. But, depending on the hosting server you use (I use Bluehost), you should be able to have another username other than admin, and then just create an email address with firstname.lastname@example.org in addition to the custom one you have created for your website that uses the custom username you have created.
Password: put in a password of your choosing. Make sure to write it down somewhere for your reference! You will have to type it in twice. WordPress will indicate whether your password is very weak to strong. Adjust it accordingly. It will also provide you with a Hint as to what kind of password to create with the best results.
Your email: put in the email you want to associate with this WordPress installation.
Privacy: Make sure that you check “Allow search engines to index this site”. It doesn’t matter for the purposes of a site you create for a class, but when you create a site that you will migrate to “live”, you should most definitely check this box so that people can find it.
Then click on “Install WordPress”.
- Next, if everything goes well, you will be taken to a page that states:
“All right, sparky! You’ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…
Click on “Run the install”.
- If you’ve gotten to the point of “Run the install”, you should be directed to the “Success!” page. Here you are told:
“Wordpress has been installed. Were you expecting more steps? Sorry to disappoint.
Username: the username you have chosen appears here
Password: The words “Your chosen password” appear.
Click on the “Log In” button. You are directed to your WordPress login page.
For future reference, your login page for your local WordPress installation should be:
or “wordpress” should be replaced with whatever you chose to call your wordpress database and the original wordpress folder in your Sites folder on your laptop/desktop.
- You should have been directed from the “Success!” page to your local WordPress installation login page. Here, you will type in your username and password you created on the Welcome Page (step 18).
- Now you should be in the dashboard of the admin area of your WordPress website. This means that you have successfully installed MAMP and WordPress, and successfully logged in to your website.
Now click on your site name located at the top left of the screen within your admin bar and click on “Visit Site”.
- You should be directed to your sample blog post entitled “Hello World!”. This comes with every default installation of WordPress. You’re good to go!
Troubleshooting the local WordPress install and MAMP
- I, however, did not have such a smooth sail with my local WordPress installation. The first time I attempted to install my WordPress download onto my desktop, install MAMP onto my desktop ( version 3.2, which was the latest version of MAMP at the time), create my database and add user in phpMyAdmin, and then finish the WordPress installation starting with step 15 on, I was successful. The next day, however, I was not able to initiate my APACHE server, only MySQL, and I had no idea what had gone wrong. It was a nightmare for me. I thought, “I’ve already done the install, why isn’t it successful now?” As far as I was concerned, there were no changes to the wordpress folder on my laptop. I hadn’t touched it. I hadn’t done anything different to my MAMP version 3.2. So what happened? I deleted my wordpress folder and re-installed it over and over, and deleted my MAMP installation over and over, but to no avail. I became confused, because I had never done this before. I wasn’t able to connect with anyone through Screenhero because I was the only one who had an account, and they no longer are accepting new ones. Why? When Slack took them over, they disabled the addition of new accounts. I tried to talk my way through my issue, and added as many screenshots as I thought relevant, but to no avail. No one seemed to be able to figure out the problem.
I did what I have always done in the past, which eventually would result in successful resolution of troubleshooting issues most of the time. I searched for resolutions to my issue on the MAMP forum. I searched for resolutions on WordPress.org. On MAMP, one guy had very recently mentioned that he wasn’t able to initiate his APACHE server with MAMP 3.2, and finally decided to revert to the previous version 188.8.131.52, and it worked for him. I stored that information for future reference. I learned much later somewhere in the WordPress forums that sometimes there were conflicts between MAMP and certain browser extensions. They were specifically SSL related extensions or website installs, and anti-virus applications. I use HTTPS Everywhere, a browser extension, in my case, Chrome, which simulates installation of SSL in your browser so that wherever you visit the web, HTTPS is enforced, unless it is prevented from being enforced, as sometimes can be the case for whatever reason. This extension is NOT a perfect science, and has been known to create conflicts and issues. When I read about the potential SSL issue, I disabled the HTTPS Everywhere Chrome extension. APACHE still didn’t start up.
Then I tried to get my answer from yet another source, because I was determined to cover as much ground as I could before giving up for the night. I had already almost given up, right before this move. I went onto Gitter. Some of you might remember my post about Gitter entitled “The latest Gitter chatter”. For those of you who didn’t read the post, Gitter is the Twitter of Github. It’s where developers gather to talk about developer related topics. I figured that someone would have the answer to my burning APACHE question! MAMP can’t work if APACHE and MySQL aren’t both started and lit green. The Nginx port is not an option for a local WordPress install. I don’t know yet what it is for, but MAMP doesn’t only work for WordPress installs. I found this out when I went into my httpd.conf file located in my apache folder within the conf folder in the main MAMP folder. MAMP is also used for Python and Perl. Now, why did I go into the httpd.conf file? Because someone had said on WordPress.org that if there are APACHE issues, one should check in the httpd.conf file whether or not the following code was there:
DirectoryIndex index.html index.php
DirectoryIndex index.wsgi index.py
If all this code is in the httpd.conf file starting at line 254, then APACHE will startup. It will know to find the index files for PHP, Perl, or Python.
That was the case with my httpd.conf file. That meant that there was another issue that I wasn’t aware of.
- So let’s go back to what I learned on Gitter. One guy told me to type the following code into my laptop’s command line terminal located within my Utilities folder:
“sudo Isof -i -P” (omit the quotation marks)
What result is this code supposed to come up with? When you type this code into your Mac’s command line terminal, it is supposed to tell you what other applications might be using your 8888 APACHE port needed for starting up APACHE in MAMP. Just to be clear: Terminal is a program installed in your Mac. It comes pre-installed on your Mac when purchased. The terminal program is a terminal emulator. According to the book “Take Control of the Mac Command Line with Terminal” by Joe Kissell, © 2012, TidBITS Publishing, Inc.,
“A terminal emulator simulates a terminal – the devices people used back in the days of monolithic mainframes. A terminal consisted of little more than a display (or even earlier, a printer), a keyboard, and a network connection of sorts. Terminals may have looked like computers, but all they did was receive input from users, send it along to the actual computer (which was likely in a different room or even a different building), and display any results that came back. A modern terminal emulator program provides a terminal-like connection to a shell running either on the same computer or on a different computer over a network.
Quite a few terminal emulators run on Mac OS X, but the one you’re most likely to use is called – you guessed it – Terminal, and it’s included as part of Mac OSX. Although you’re welcome to fine and use a different terminal emulator if that’s your preference, in this book I discuss only Terminal.
Note: At the risk of redundancy, I want to emphasize where Terminal fits in the scheme of things. A common misconception is that Terminal is the Mac OS X command-line interface. You’ll hear people talk about entering “Terminal commands” and things of that sort. (Even I have said things like that from time to time). But that’s incorrect. Terminal is just a program – one of numerous similar programs – that gives you access to Mac OS X’s command-line interface. When you run a command-line program, you’re running it in a shell, which in turn runs it in Terminal.
So, to summarize: you use Terminal to run a shell, which provides a command-line interface with Mac OS X – a variety of Unix (of which the non-graphical portion is known as Darwin). You can use the Mac OS X command-line successfully without having all those facts entirely clear in your mind, but a rough grasp of the hierarchy makes the process a bit more comprehensible. BTW, a shell
“is a program that creates a user interface of one kind or another, enabling you to interact with a computer.*” (location 193, Kindle ebook for iPhone 6)
in Mac OS X, the Finder is a type of shell – a graphical shell – and there are still other varieties with other interfaces”. (location 193, Kindle ebook for iPhone 6)
This book was the only source that explained most closely “sudo Isof – i -P”.
However, Kelly provided the command
“Isof -i” – which allows you to see a list of processes you own that are accessing the Internet” (location 2002, Kindle ebook for iPhone 6).
To see a list of all processes accessing the Internet, you would enter “sudo Isof -i”.
Either way, you would get a list of the processes on your Mac that currently have Internet connections, along with the domain names or IP addresses to which they are connected, the ports they are using, and other useful tidbits.” (location 2002, Kindle ebook for iPhone 6)
According to Kelly, “sudo Isof -i” returns a list of the processes on your Mac that are using ports at that moment and which ones they are using. In my case, it would have been what else was using the 8888 APACHE port other than MAMP.
IT guys I had worked with in the past would use my command line terminal to troubleshoot various issues on my computer, but I never used it before, so I didn’t want to take a chance. I did type in the code and hit return, but the terminal asked me if I was sure I knew what I was doing, and to proceed with extreme caution. I canceled the request! There had to be another way to resolve my problem.
I know that I looked elsewhere for more “solutions”, and didn’t come up with anything else new. So I decided it was too late to function properly, and called it a night.
- The next morning, Friday, April 10, 2015, I woke up SUPER early, and with a much clearer mind. I immediately turned off two things: HTTPS Everywhere, and Avast anti-virus application. I also removed the images folder from the Sites folder on my desktop. I figured the images were too old to be relevant.
Then I decided to visit the WordPress Codex regarding installing MAMP and WordPress local installs. I visited Installing WordPress Locally on Your Mac With MAMP in the WordPress Codex. Interestingly enough, the version of MAMP that was there was not 3.2, but 184.108.40.206! I decided “What the hell, the WordPress Codex knows what is the best version to use for Mac users with the latest Mac operating system, and I downloaded the 220.127.116.11 version that was available on the WordPress Codex page.
I went through all the MAMP steps again, and this time I was able to start up APACHE! I thought, great! Now everything else should fall into place. I also had a wordpress folder installed in the Sites folder, but when I got to step #16, where I had to enter the Database Name, Username, Password, Database Host, and Table Prefix, I was asked whether I was sure that I had WordPress installed? Only my Username and Password were recognized.
I knew at this point that I would have to go back and check out two places:
a. The wp-config.php file in my wordpress folder within the Sites folder on my desktop
b. Check that my wordpress database in phpMYAdmin existed
These were the only two places I hadn’t revisited lately. I had made so many installs and uninstalls that I had lost track! When I checked to see whether the wp-config.php file in the latest install of WordPress on my laptop had my Database Name, Username, Password, Database Host, and Database Charset, they weren’t in there. In fact, there was only a wp-config-sample.php file with none of the necessary information. So what did I have to do? I had to manually input my Database Name, Username, Password, Database Host, and Database Charset. Warning: if you have a wp-config-sample.php file that needs configuring, don’t change it to a wp-config.php file. As you continue with your local WordPress install, WordPress will automatically change your wp-config-sample.php file to wp-config.php. If you try and do it on your own, it will tell you at one point that you need to re-install wp-config-sample.php in order to continue with your local WordPress installation.
- Then I had to go to phpMyAdmin and double check to see whether my wordpress database existed there within the Database tab. It did not! For some reason, my last database creation didn’t take. I had to re-create it (step #13). I double-checked step #14 (adding a User). I clicked on the User tab, and my user was there! So I went back to see if my http://localhost/wordpress would appear now. It did! I was taken to “select a language” screen (step #15). Then I went through the motions again and finished the local WordPress installation (steps #16-#24). From then on, it was smooth sailing. I have logged in to my local WordPress install many times since!
One thing to note, however. Today, when I clicked on the MAMP link within Installing WordPress Locally on Your Mac With MAMP in the WordPress Codex in order to get the link for the version of MAMP I had installed on April 10 (version 18.104.22.168), version 22.214.171.124 was no longer there! Version 3.2.1 appeared. This, however, was not even the same latest update I had seen when I visited the MAMP website directly. It had been 3.2! I checked to see when 3.2.1 had been released, and the date is April 10, 2015. It must have happened after I left New York City. There definitely was something in 3.2 that had not been compatible with something on my computer. 3.2 definitely had not been compatible with the two applications I had turned off (HTTPS Everywhere and Avast anti-virus). They prevented APACHE from starting. At least one of them (probably Avast) also caused the images folder to appear in the Sites folder (but I can’t swear upon it). Initially reverting to 126.96.36.199 had helped! I was able to start up APACHE with it. APACHE didn’t start up with 3.2 even after I had turned off HTTPS Everywhere and Avast anti-virus. There must have been a permanent fix for OS X Yosemite in 3.2.1. They had been talking about a Yosemite fix in the MAMP forums and on Twitter.
What did I take away from this experience?
1. If you can’t get APACHE to startup, check to make sure that there isn’t anything else on your computer that is running APACHE on the same port you are using in MAMP. It could be local to your computer, in which case you could use Mac’s Command Line with the Terminal program installed on your computer to find out what might be using APACHE Port 8888 needed for MAMP installation and use. If that doesn’t come up with any conflicts, then check which of your Browser extensions might be conflicting with APACHE. If you are using HTTPS Everywhere and/or Avast anti-virus (or any other anti-virus extension), turn them off immediately. If you aren’t using either, but APACHE won’t start, turn off your extensions one by one, until APACHE does start.
2. If APACHE is working, but you still haven’t been able to complete your local WordPress install, make sure to check that your wp-config.php file in your WordPress folder located in your Sites folder is configured properly (refer to step #33).
3. If APACHE is working, and you have configured your wp-config.php file as per step #33, and you still can’t finish your local WordPress installation, then make sure that you actually have a wordpress database and the right user configuration in your phpMyAdmin.
4. When you have made sure that these three steps have been completed, then try and finish your install again. Most probably you will be successful this time around!
Remember, however, that everyone’s computer environment is unique. Chances are no one has the exact same scenario as someone or anyone else. This post serves as a guideline of things to consider when facing local WordPress install troubleshooting issues. Hope this helps others with their local WordPress installs!
This article was originally published on the LetsBSocial Singles Community and Support Network Blog
Take Control of the Mac Command Line with Terminal: Joe Kissell, September 19, 2012, TidBITS Publishing, Inc.
Macintosch Terminal Pocket Guide: Daniel J. Barrett, June 13, 2012, O’Reilly Media
Troubleshooting MAMP Pro: Maria D. Campbell, June 23, 2015, MariaDCampbell.com Blog
Installing WordPress Locally on Your Mac With MAMP: The WordPress Codex
MAMP Installation: MAMP website documentation
Fix MAMP Not Working Issue in Yosemite OS X: April 1, 2015, WebNots
Mac OS X Yosemite and MAMP Problems: Nick Savov, March 13, 2015, OSTraining
Why won’t Apache Server start in MAMP?: Stack Overflow (asked 2 months ago, active 3 days ago)
How to Fix the Error Establishing a Database Connection in WordPress: January 27, 2015, WP Beginner
Terminal 101: 5 Time-saving Tips and Tricks: Cory Bohon, May 20, 2013, MacLife
Common MAMP Problems: February 6, 2013, Patrick’s Programming Blog
Installing WordPress On Mac Locally With MAMP: February 4, 2013, WP Explorer
Localhost install – wp-admin works, but frontpage is text only: WordPress Support Forums (2013)
Introduction to the Mac OS X Command Line: Jim Hoskins, September 27, 2012, Treehouse Blog