This is an absolute beginners tutorial on how to get yourself a local WordPress development environment set up on your Mac OS X with MAMP. Step by step (and with screenshots,) we’ll go through each part of the process — downloading and installing MAMP, basic MAMP configuration, creating a MySQL user and database, getting WordPress up and running, and in the end I’ll share some tips you might find useful in your WordPress journey.
What is MAMP and why MAMP?
- A working MAMP installation (MAMP can be downloaded directly with the MAMP PRO installation package). Operating system: macOS Sierra 10.12 or later A user account that is part of the Admin Group.
- Ok, I'm running MAMP 1.9.5, which includes PHP 5.3.5, on my MacBook Pro. The 'intl' extension isn't included/activated and I've tried a lot of different ways to install it ('./pecl install intl' doesn't seem to do it), but can't make it work.
- Step 8: Click on the Install button to begin installation. Step 9: Once the installation is complete, you will see a green checkmark with a satisfying audible noise. Step 10: Open Spotlight Search by hitting Command-Space keyboard shortcut and search for 'MAMP'. Step 11: Open MAMP by selecting the top result returned from the Spotlight Search.
- MAMP installs a local server environment in a matter of seconds on your Windows or macOS computer. MAMP comes free of charge, and is easily installed. MAMP will not compromise any existing Apache installation already running on your system.
MAMP is a free, local server environment that can be installed under macOS and Windows with just a few clicks. MAMP provides them with all the tools they need to run WordPress on their desktop PC for testing or development purposes, for example. With the help of our local DNS server NAMO, you can even easily test your projects on mobile devices.
WordPress is not a stand-alone application. In order to work, it requires a special set of server software that your hosting company will typically provide for you, but such software is not pre-installed on your local Mac. This means that in order to run WordPress locally, you would need to install and configure the set of software yourself, but luckily there’s MAMP!
MAMP is a stand-alone application for Mac OS X which brings server power to your home or office desktop or laptop. It bundles the typical software stack you’d need to run all sorts of web applications including WordPress; that is the Apache web server, a MySQL database server and a PHP interpreter. As you might have noticed, those three are the “AMP” part. The first “M” stands for Macintosh, or as we call it nowadays — Mac.
Installing MAMP
If you’re a Mac user, you’ve probably gone through the process of installing new software in OS X, and MAMP is not too different. Let’s browse to the MAMP website and get ourselves the latest copy of the software. It’s usually bundled with MAMP PRO trial (a commercial and more advanced) version, but we’ll be using the free version which is enough to get you started.
Once the download is complete (over a hundred megabytes,) extract the contents of the archive somewhere, your desktop is a good place. You’ll see that it contains a MAMP.pkg package which you can run. You’ll be greeted with a user-friendly installer where you’ll have to keep hitting Continue to get through each step.
Note that during the Installation Type step, you can hit Customize and uncheck MAMP PRO which would skip the trial commercial package.
After MAMP has been installed, you can launch it using the Applications tab in your dock or by searching for MAMP in Spotlight. Note that when starting and stopping services and changing the configuration, MAMP may ask you for your password, which is required to make system changes in OS X.
The Status section on the left will show you when the Apache and MySQL services are started or stopped. After changing any configuration, you might need to restart the servers for your changes to take effect.
Configuring Apache & MySQL Ports
This step is quite important. By default MAMP sets non-default ports for Apache and MySQL in order to avoid possible conflicts with other running applications, so unless you’re using some software that occupies the default ports, it would be nice to change them. Apache to port 80 and MySQL to port 3306.
Use the Preferences button, and then the Ports tab to make the necessary changes. MAMP will have to restart your servers for the changes to take effect.
Now while you’re at the MAMP preferences, hit the Apache tab to be able to select a directory root. This is like the public_html folder on your web hosting server, but a local one. That’s where you will install WordPress and store all your project files. A folder in your Documents is a good place to start. I’ll call it my_document_root.
To make sure everything is working correctly, let’s create a new PHP file in the directory we just set as our document root. Call the file index.php and have its contents say something simple:
Then get your web browser to point to localhost and if you’re lucky enough you’ll see the PHP info page that looks like this:
Hurray, now delete that file and let’s get a MySQL database ready for WordPress.
Creating a MySQL Database for WordPress
Now, before installing WordPress we need a database where it would store its data and settings. MAMP ships with a database manager application called phpMyAdmin and the WordPress Codex has a guide on how to create a database with that, but let’s take a shortcut here and fire our Terminal in OS X. You can find it in your Applications folder or easier, through Spotlight.
The Terminal is a command line utility to your Mac, sort of what you might have heard about Linux, DOS and so on.
If you’re planning to become a kick-ass WordPress developer, you’re going to have to learn this tool. We’ll type in a few commands (which you can easily copy and paste) that will connect to your local MySQL server, create a new database for WordPress and then create a new MySQL user with access to that database. Ready?
Don’t get too scared yet, it’s quite simple if you understand what each command does. The first one connects to our local MySQL server using root as the username (the -u argument) and root as the password (the -p argument.) These are the default settings in MAMP. Note that there is no space character between arguments and their values. If that gives an error, you should explicitly tell Terminal where the MySQL binary is (where you installed MAMP,) in my case it’s:
If everything’s correct, the first command will open a MySQL command line (in the same Terminal window) to which you type in the rest of the commands or as they’re called SQL queries. The first query (second command) is straightforward — it will create a new database called wordpress and the second query will grant all possible privileges (read, write, delete, etc.) on every table in the wordpress database, to the wp user originating from localhost identified by the hello password.
The third query exits the MySQL shell, at which point you no longer need Terminal so feel free to close it. Here’s a screenshot from my Terminal to make sure you’ve done everything right:
As you might have guessed, the bolded words in the paragraphs above are the values we’re going to use when setting up WordPress, so we’re really close now!
Installing WordPress
Okay, I assume you already know where to get the latest version of WordPress. Download the ZIP archive and extract it to that document root directory. The one where we created our index.php file, remember? Note that the archive might (and probably will) extract an additional folder called wordpress with all the WordPress files inside. Feel free to move all the contents of that folder back to your document root and then delete the empty WordPress folder.
Now, open your browser and point your web browser to localhost again. This should bring up the WordPress welcome page and then on to your database settings, which you probably are familiar with already.
The database name, username, password fields are the ones we used when creating the user and database, remember? The host field is localhost because MySQL is running on the same computer (your computer) as the Apache web server. The table prefix is up to you. I generally leave it wp_ for local installs.
The rest is pretty straightforward, blog name, admin username, password and e-mail. After having filled those in you’re left with your brand new and empty WordPress installation, on your local machine, running MAMP. Congratulations!
Conclusion
I’d like to end this tutorial with a few short tips you might find useful when working with WordPress locally on MAMP.
- While MAMP itself is a lightweight application, when working for a long time without turning it off (and without restarting your computer,) it can get a little laggy and use too much memory. Kick it around from time to time.
- If ever needed, Apache and PHP configuration files are located in MAMP’s conf directory, that’s /Applications/MAMP/conf.
- Apache and PHP binaries and service scripts are available in MAMP’s bin directory, Apache, PHP and MySQL logs are in the logs folder (duh.)
- You don’t need MAMP PRO unless you’re 100% sure you do.
Final tip — whenever you become a MAMP ninja, don’t stop there! Your next goal is being able to run a local virtual machine with your favorite Linux distribution linked to your Mac OS X with a network file system or something similar. That would really get you closer to the real world hosting environments, and a better WordPress pro.
Thank you so much for reading, hope you enjoyed it and feel free to ask questions, post comments and come say hi on Twitter too. Cheers and thanks again!
Today I installed WordPress locally on my Mac and I used MAMP
to achieve my goal. With MAMP it’s very easy to run WordPress on Mac within 10 mins
. Install MAMP on Mac.
Let’s get started. You just have to follow below simple steps and you should be good to go.
Step-1
We need Apache Server
and MySQL
in order to run WordPress locally. Download
MAMP and double click on binary to install
it.
Step-2
Open MAMP. You may also see MAMP Pro
as a part of install. We are going to use MAMP Free
version.
Step-3
Change Apache Port to 80
and MySQL Port to 3306
as per below snapshot.
Step-4
Change Document Root
as per your need. Mainly under /Document
folder.
Step-5
Install Joomla On Mamp Mac
Then click OK
and click on Start Servers
. Provide administratorusername
and password
as we are going to start server on port 80
. You should see both green icons as shown in below diagram.
This page by default opens in default browser: http://localhost/MAMP/
. Keep that page open and move to next step. We will come back again on that page.
Step-6
Now Download WordPress.
Step-7
Extract wordpress.zip,
change name to crunchify
and copy folder under Document Root, i.e. MAMP
Step-8
Now go to your browser page http://localhost/MAMP/
again. Click on phpMyAdmin
.
Step-9
Create new DB called crunchify_db
and click on Create
.
Step-10
Point your browser to http://localhost/crunchify
to install WordPress locally. Provide all appropriate information as mentioned below.
Step-11
Now check your browser again pointing http://localhost/crunchify
and you should be all set.
mamp wordpress install tips.
Join the Discussion
Mamp Mac Os
If you liked this article, then please share it on social media. Still have any questions about an article, leave us a comment.
How To Use Mamp Mac
Other Popular Articles...
