2012年11月23日星期五

Codex tools: Log in Installing WordPress Locally on Your Mac With MAMP


Codex

Installing WordPress Locally on Your Mac With MAMP

Contents

[hide]

What is MAMP?

MAMP stands for Macintosh, Apache, MySQL, and PHP. MAMP is an application you can install on your Mac which allows you to have access to a local PHP server and MySQL server. Essentially, MAMP gives you all of the tools you need to run WordPress on your machine, fordevelopment and testing purposes. You can accomplish this in different ways, but the other ways aren't nearly as simple (seeMacOS_X_Local_Mirror for the long, manual version of installing PHP and MySQL on your Mac).

Step 1: Installing MAMP

Before you can install MAMP on your Mac, you'll need to download it from the MAMP website. MAMP requires that your Mac be running Mac OS X 10.6.6 or later.
Once the MAMP download is complete, double-click the MAMP disk image (it should be something like MAMP_2.0.3.dmg), and you should get a MAMP window pop up. Drag the MAMP folder (not MAMP PRO - we'll save that walk-through for another time) to the Applications folder.

Step 2: Basic MAMP Settings

Now that you've got MAMP installed on your system, launch MAMP.app (located at /Applications/MAMP/MAMP.app).
While you're editing settings, MAMP might prompt you for an administrator password. This is required because MAMP needs to run two processes: mysqld (MySQL) and httpd (Apache), and depending on the settings you set for those processes, you may or may not need to input your password.
Once you open MAMP, click the Preferences button. Next, click over to "Ports." The default MAMP ports are 8888 for Apache, and8889 for MySQL. If you use this configuration, you shouldn't get asked for your password, but you'd need to include the port number in the URL (localhost:8888). If you'd like to leave the port number out of the URL, change the Apache port to 80. The downside of using port 80 as your MAMP Apache port is that you'll always be asked for your password.
On the PHP tab, select PHP version 5. The PHP minimum requirement for WordPress was raised to 5.2.4+ in version 3.2.
Lastly, on the Apache tab, you'll need to set a document root. This is where all of your files are going to be for your local web server. An example of a document root is /Users/USERNAME/Sites/wordpress/.
Once you're done editing all of the settings, hit OK to save them.

Step 3: Starting MAMP Servers & Creating The Database

To start the MAMP Apache and MySQL servers, simply click "Start Servers" from the main MAMP screen. Your MAMP servers have now been started.
Once the MAMP servers start, the MAMP start page should open in your default web browser. If not, click on "Open start page" in the MAMP window. Once that's open, select phpMyAdmin from the webpage.
Under "Create new database", enter in a database name such as "wordpress", and press "Create."

Step 4: Downloading and Installing WordPress

Now it's time to download WordPress. Once you've downloaded and unzipped the WordPress download, open up the "wordpress" folder. Click and drag all of the files from the wordpress folder to your MAMP document root (I use/Users/USERNAME/Sites/wordpress/).
Lastly, we've got to run WordPress' famous 5-minute install. Visit your local site (localhost:port or localhost:port/wordpress), and enter the following information into the database setup form:
database name: wordpress
database host/server: localhost
database user: root
database password: root
Once that's complete, enter a blog name and email address, and you're ready to use WordPress on your Mac.