Learn how to configure MAMP to work properly and effectively as a host for WordPress on Mac.
- [Instructor] Once you've installed MAMP on your computer, you'll find it under Applications by scrolling down towards M. And here you'll see there are two folders, MAMP and MAMP PRO. MAMP holds the application itself. And here you have the start file and everything else. The MAMP PRO folder currently only holds the installer and uninstaller. That's because we have yet to actually install it. We'll cover MAMP PRO in detail in the next chapter, so in this chapter we're focusing squarely on this folder, MAMP, and the application that sits inside it, which is just this file here, MAMP.
The first thing we need to do is just open MAMP on the computer. Just double-click on MAMP. This brings up this warnings that says the configuration software MAMP PRO is installed. We recommend to administer the server only via MAMP PRO, because a concurrent use of both programs can lead to unexpected results. This warning has to do with the fact you can theoretically have both MAMP and MAMP PRO running at the same time, but that's a really bad idea. It's asking you, do you want to launch MAMP, or do you want to launch MAMP PRO.
Now, once you make a selection here, you can then tell the application I don't want to get this selection every time, or you can do it right now by unchecking this box, which is what we'll do. Then, you'll always either launch into MAMP or MAMP PRO. So, for now, we're going to launch MAMP. In the next chapter we'll look at how to change this setting so we default to MAMP PRO instead. Only thing you need to worry about here is not running both at the same time, and thanks to this warning and the settings inside MAMP and MAMP PRO, that's not very easy anyway, so you don't really have to worry about it.
Just uncheck this box, and click Launch MAMP. This takes you to the MAMP dashboard, and, as you can see, the free version of MAMP is really straightforward and easy to use. All you have here is an indicator to tell you whether the Apache server and MySQL servers are running. When they're running you'll have a little green box inside these boxes here. Then you have three buttons, the Preferences, the Open WebStart page, which is currently grayed out because the servers are not running, and, finally, the toggle to start and stop the servers. There's also a section here at the bottom that advertises MAMP PRO.
We're just going to ignore that. Like I said, we'll cover MAMP PRO in the next chapter instead. Now, technically, you can start MAMP right now by clicking Start Servers, but before you do that let's go into Preferences and configure MAMP to work well on your computer. Click on Preferences and you get the Preferences panel. Here, you have a series of tabs. We'll go through them one by one. The first tab, Start/Stop, configures what happens when you start and stop MAMP. Here, you first choose what happens when you start MAMP. Here, the option is Start servers.
It's always a good idea so you don't have to manually start the servers after starting MAMP. The second option is to check for MAMP PRO. That's what we unchecked in the dialog previously. If you want that warning to reappear, you just check this box again. Then we have options for checking for updates. That should always be on. And open the WebStart page. I'll show you what that is, and then you can choose whether or not you want to keep it open or closed yourself. Then, under When quitting MAMP, you have one option which is Stop servers. My recommendation is to always leave this checked.
Otherwise, when you shut down MAMP, you'll still have the web servers running in the background, and you won't have any easy way of accessing them. By leaving this checked, you ensure that anytime you shut down MAMP, all the processes shut down as well. Then, if you want to start up the servers, you just start MAMP up again. This last option, My favorite link, is, I don't know, it can be useful in certain circumstances. I'm just going to put in a link here, and then you can see what happens, and you can choose whether you want to use it. So I'll put in a link for my own courses on LinkedIn Learning, and then a little later on you'll see what this does.
That's all for Start/Stops, let's move on to Ports. These ports are the different ports inside the computer that are used by different applications to send communication back and forth. Each application you run on your computer needs its own port of doing any kind network communication. Out of the box, MAMP sets these ports to Apache, 8888, Nginx, 7888, and MySQL 8889. You'll notice that these numbers are different so that there's never a conflict. But, there's a bit of a catch here.
If you leave these settings as-is, what'll happen is, when you go to the browser to open up the web browser for MAMP, you'll have to type in localhost:8888 to get to the Apache port, and localhost:7888 to get to the Nginx port. That's fine, but in certain circumstances, especially when you're working with WordPress and some plugins, that might become a problem. So, you can try to change these to the default ports. There's a button down here that sets web and MySQL ports to 80 and 3306.
These are the default ports for web traffic, meaning if you click this button and you reset these values, these values are the default values for web servers. So, if you go to your web browser and just type in localhost, nothing else, it will always go looking for what's on port 80. That means if you have no other web services running on your computer, this will work fine. However, if you do have other web services running on your computer, you'll get a conflict. You'll be told there's a conflict, and then you'll have to go change things back.
If you need to change 'em back, simply click on Set MAMP ports to default, and you'll go back to 8888, and 7888, and 8889. We're going to try this and see if it works. If it doesn't, just come back, click Set MAMP ports to default, and everything will work fine. Next, we have PHP. Here, you can choose one of two PHP versions that are installed with MAMP by default. If you want additional PHP versions, I showed you how to do that in a previous movie. You go into the installer and download a new PHP version, then you get them listed right here.
Now, in most cases, just use the latest PHP version installed. The only reason why you'd ever want to go back to previous versions is if you're trying to mimic a server environment somewhere else that's using a specific version of PHP and you have to have an exact match. So, for all intents and purposes, just leave this alone. There's also a cache open. Because you're running this on a computer, caching makes no sense, but, if you need to mimic caching, you can go in and click on this, and then select whatever caching you want to use. The next tab is Web Server.
Here, you first choose what web server you want to use. You'll remember MAMP ships with two. We have Apache, which is the default, the most common one you see on the web. And then we have Nginx, which is the new up and coming web server a lot of modern servers are using. A lot of web hosts that specialize in WordPress now run Nginx. In most cases, it doesn't really matter which one you pick. I would pick Apache unless specified otherwise. The only time I'd pick Nginx is if I'm trying to match a server environment exactly because I'm testing out some custom code.
So, for most cases, just leave this one alone and move on to the next step. The next step is to set the document root. The document root is where Apache goes to look for the files. Right now, the files for the website sit under Macintosh HD, Applications, MAMP, and htdocs. That's fine, but it's not easy to get to when you start working with files, so I like to change this. Click the folder icon, and go to Documents. Here, I've created a folder called Sites, and that's where I want to place all my files.
So I could just select that instead. That means anytime you boot up Apache and boot up MAMP, you automatically point at the Sites folder, and whatever's inside the Sites folder will become the website you work with. Finally, you have MySQL. You just get information about what version of MySQL you're running, nothing else. If you ever need to know, this is where you find it. All right, that's all the configuration we need to do. Click OK, and then we can start the servers. That's done by simply clicking this button here. Now, the application will try to boot up the Apache and MySQL servers.
If your security levels are high enough on you computer, you'll get a question like this. MAMP wants to make changes. Enter your password to allow this. This is just your login password for your computer. If your security settings are high enough, you'll get that question every single time you boot up MAMP. That's good, because when you boot up MAMP you're making changes to your computer. When everything works properly, you're taken here to the WebStart page. I told you before that this WebStart page, you have to choose whether you want to see it every time you boot up.
This is the page I'm talking about. Here, you get information about the current MAMP version you're running, PHP, MySQL. There's some code examples, and some other information. Then, you can go in and look at your website, which is just localhost, or you can go to phpInfo. There's some Tools here. There's an FAQ. And, finally, we have My favorite link. That's that My favorite link I filled out. Remember, it points to LinkedIn Learning and all of my courses. When you click on that, you go here. Like I said, this can be useful, and can not be useful.
My guess is you would use this either to go directly to some specific documentation, or you might use it to go directly to the current site you're working on if you installed a bunch of different sites on your computer. But, in my case, I generally go into Preferences and take that away entirely, because I don't want to use it. Now that you've seen what this WebStart page is, there is a good chance you don't want to see it every time you boot up MAMP. If that's the case, go back in to Start/Stop here and uncheck Open WebStart page, click OK, then stop the servers, go into your browser, just shut the browser down.
Then, when I start the servers again, see the same process happens. You boot up all the servers. Eventually, the Apache and MySQL indicators will both turn green telling me that both servers are running. The icon itself turns green. The browser does not open, but then if I click Open WebStart page, browser opens to the WebStart page again. It's not like we're taking the WebStart page away, we're just simply saying don't open this page unless I explicitly tell you to. That really is all there is to it. If you see what I'm seeing right now, that means MAMP is running properly on your computer, and you're ready to take the next step, which is to get MAMP to work with WordPress to run WordPress sites locally on your computer.