How To: Install WordPress on Mac OS X Using MAMP


I’m a huge fan of Wordpress. It’s so simple yet so powerful. If you’re new to Wordpress development of any type, you probably get tired of having to upload your changes to the web via FTP just to see them. Well, I’ve got good news for you – you don’t have to do that! You can setup a development environment so you can test everything locally on your computer.

Your next question might be one like this – “How do I setup a test environment on my Mac? I know that the Apache web server is included in OSX but I can’t figure out MySQL or PHP. “

It’s true that OSX comes with Apache, and you could use it, but there is a much simpler way. Use MAMP. MAMP stands for Mac, Apache, MySQL, and PHP. You have probably heard of LAMP (Linux, Apache, MySQL, and PHP) which is the standard web development platform on the internet. There is also WAMP; Windows, Apache, so on and so forth. One more acronym, WIMP; Windows, IIS (Internet Information Server. The default Windows web server), MySQL, and PHP.

All these acronyms provide all the necessary components to run Wordpress locally on your given platform. In this case, the wonderful OSX.

Anyway, here is a step by step tutorial on how to install Wordpress on OSX using MAMP.

Install MAMP

  • You first need to install MAMP. You can download it here.
  • Next, drag the entire MAMP folder to your Applications folder.
  • In the MAMP folder, open the MAMP application (located at /Applications/MAMP/MAMP.app).
  • Click the Preferences Button

    mamp_program

  • Click the “Set to default Apache and MySQL ports” button and then click OK.

    mamp_ports

  • In the MAMP program window, click the “Open start page” button. The home page for your new MAMP installation should appears. If you see the page, you know everything is set up correctly—you’re actually viewing this page through an active Web server on your own computer.

    mamp_page

    From this page you can access phpMyAdmin, a Web-based tool for managing a MySQL database (you’ll be using phpMyAdmin to help set up the database for the tutorials).

TIP: Since you’ll frequently access the MAMP program to turn the Web server on and off, it’s a good idea to add it to the OS X Dock.

Install Wordpress

  • After MAMP is up and running, download the latest version of WordPress. Once the download is complete, uncompress it and copy it to the “htdocs” folder under the MAMP folder on your applications menu. Screen shot 2009-10-28 at October 28, 2009   2.00.35 PM


  • Next, we need to create a database so we can run WordPress. Open up the MAMP Startup page (there is a button on the control panel window), and go to phpMyAdmin.
  • In the MySQL column, there is a table for creating a new database.
  • After your database is created, open up the ‘wp-config-sample.php’ file in the root WordPress folder. Change the database name to ‘wordpress’ (or whatever you called your database). Both the username and password are ‘root’, and the host is localhost.

define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'root'); // Your MySQL username
define('DB_PASSWORD', 'root'); // ...and password
define('DB_HOST', 'localhost');

  • Save this file as a new file with the name wp-config.php.
  • To install WordPress, open up wp-admin/install.php. From there, it’s the standard, simple WordPress installation.

If you want to run multiple blogs with their own themes, all you have to do is repeat this process, and give each database a new name. You can use the same database if you like – some people prefer to have certain sample posts to test things.


And that’s it! You’ve successfully setup MAMP on your local machine. Now you can crank out Wordpress themes all the time?


Do you edit Wordpress themes locally? If so, how do you do it? Do you have a way of doing things differently?

,



  1. #1 by Rich on November 24, 2009 - 6:28 am

    Hi

    Great “How to” followed it and it work perfectly, thank you!

    I am really starting to appreciate the benefits of Wordpress, as a traditional designer with some basic knowledge of HTML and CSS I feel this platform is ideally suited to me.

    The problem I have now is how to I upload my local files (Wordpress Folder) on the mac to the remote server with my FTP software (Dreamweaver)

    Thanks in advance!

  2. #2 by Matt Brown on November 24, 2009 - 10:24 am

    Thanks Rich. I’m glad it helped you.

    To help with uploading from Dreamweaver via FTP, you need to understand the basics of FTP transfers. This article should help – http://kb2.adobe.com/cps/147/tn_14787.html

    But, you will have to get complete configuration instructions from your specific host.

    If you’re doing some more Wordpress work, be sure to check out my free Wordpress Foundation Themes Starter Kit – http://themattbrown.com/wordpress-foundation-themes/

    Thanks.

  3. #3 by Rich on December 1, 2009 - 5:13 am

    Hi Matt

    Thanks for your help previously, I am really getting my head around WordPress I am still having some problems, following the links and tips on the links you previously supplied to upload from my Mac to the remote server I am unable to do so. I have tried Dreamweaver and Filezilla without success. I have successfully connected to the remote server with both applications but then have hit a brick wall.
    Your experience in this would be greatly appreciated if you could help find a solution.

    Many thanks again for you advice and sorry to be a pain!!!!
    Rich

  4. #4 by Matt Brown on December 1, 2009 - 11:31 am

    Have you installed Wordpress and created all of the databases?

    http://codex.wordpress.org/Installing_WordPress

  5. #5 by Rich on December 1, 2009 - 11:56 am

    I am pretty sure I have, the site works fine locally, when I use dreamweaver, filezilla or fetch I get access denied trying to upload the index.php file, the htdocs folder or wordpress folder to the server, I have exhausted all the options.

    so frustrating!!

(will not be published)