Are you a novice WordPress developer and want to test how your newly built website functions on Windows or Mac?
Do you want to make changes to your site’s design without disrupting what visitors are viewing on your live site?
Or maybe you would like to check how your newly installed theme or plugin works before your website users can see it?
No matter whatever your requirement may be, carrying out the development on your local machine can help you deal with any issues that might crop up during the development process.
This post will run you through the process of making your WordPress site run on a Mac system.
Let’s Get Started
When developing a website on the WordPress platform, you may feel constrained to perform development tasks on a live server. If that’s the case, then you can choose to run your site on a local server instead. However, for local development on your Mac system, you’ll need a server backend.
This is where MAMP comes in handy.
MAMP is an application that helps run your WordPress installation on your Mac locally for testing and development purposes. Basically, installing MAMP (also referred to as Macintosh, Apache, MySQL, and PHP) on Mac gives the ability to create WordPress sites on a local virtual server. So, to begin working with the MAMP application, you’ll have to first install and configure it.
Installing and Configuring MAMP
Before installing MAMP, you will have to first download the application from the MAMP website.
Note: In order to download the MAMP application, you’ll need to ensure that your Mac version runs on OS X 10.6.6 or higher.
After the download process is finished, double-click on the downloaded .pkg file and a MAMP window will appear, asking you to install the MAMP software. Next, drag and drop the MAMP folder into your applications folder.
Let’s now proceed with configuring MAMP. For this purpose, simply follow the below given instructions:
1. Open up your “applications folder”, and you’ll be able to see the MAMP folder in it along with many other folders and applications. Simply launch the MAMP.app, for setting up a local server.
2. When you’ll open up the MAMP app, a window will pop up that looks something like the image shown below:
3. Click on the “Preferences” button and the following window will appear:
4. We’re skipping the other available options (as shown in the above image) and moving directly to the “Apache” tab. However, make sure to view the details that need to be entered in the left over options from the WordPress Codex.
For your local WordPress installation, you’ll require a place where you can keep all the files that needs to be accessed by the MAMP software. MAMP, by default, contains a folder named as “htdocs” where all your local websites and directories will be saved. You can find the path to htdocs in the Apache tab.
5. After configuring the MAMP successfully, click on the “Start Severs” button, and the following webpage will open up in your default browser:
Starting With Installing WordPress Locally
It’s about time to download your WordPress installation. For this, head towards the official WordPress website and download the latest WordPress version. Once the download is complete, unzip the folder and drag all its files to the document root for MAMP (i.e. Applications/MAMP/htdocs folder).
And, then rename the folder to something, let’s say, my-wp-site or anything you like.
Next, for setting up your WordPress installation locally, you will need to create a new database. To do so, in your browser just enter: http://localhost/phpmyadmin/. This will open up the phpMyAdmin interface (as shown in the image below). From the interface, click on “Databases”.
And then, assign any suitable name for the database and click on the “Create” button, and that’s it, your database will get created.
For example, we’ve created a database named assigned my-wp-site.
On entering the local host URL in your browser window, you’ll be able to see a screenshot such as the one below:
Remember to proceed further, you’ll also need to create a configuration file, called as wp-config.php. You can do so, using any one of the two ways shown below:
#1. Go to MAMP/htdocs and rename the “wp-config-sample.php” file to “wp-config.php” and open it up. Now edit the files using the name of the database you created as well as “root.”
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
Save the file.
Now go to your home directory (give on the path http://whatever-your-database-name-is) and follow instructions to complete installation.
#2. If you don’t know how to code, simply follow this step to create the configuration file. Click on the “Let’s go!” option and a window will open up that looks something like:
Click on the “Create a Configuration File” option and another window will open prompting you to enter the database name (i.e. my-wp-site), username (i.e. ideally root), password, etc.
After filling all such details click on “Submit”.
Click on “Run the Install” button, another window will appear. Simply fill in the information and click on the “Install WordPress” option.
If you’re a beginner and interested to learn how you can install a WordPress site locally on your Mac system, then reading this post will prove a handy guide for you.