Installing Word Press on the Mac

cowasaki

TPer Emeritus
Messages
19,708
Name
Darren
Edit My Images
Yes
Installing Word Press on the Mac

I have managed to get Word Press up and running LOCALLY on my mac using the following guide. This guide has been written by me after reading about 10 different guides that all contradict each other and generally didn't work!

Note EVERYTHING in UNIX is case sensitive make sure you follow CASE !!!!!!!

This is working on my Macbook Pro running Snow Leopard, there is a line in the middle which will be different for Leopard and Snow Leopard but this is highlighted. I have tried to make it as simple as possible.

Obtain files for install of My_SQL and Word Press

Install My_SQL

  • Locate the .dmg file in your downloads directory
  • Click on it to open it.
  • Locate the file "mysql-5.1.51-osx10.6-x86_64.pkg" (or similar)
  • Run this and follow on screen instructions.
  • Copy MySQL.prefPane to [USER HOME] >> Library >> PreferencePanes >>
  • Restart and allow My_SQL to accept incoming communications.

Add MySQL path to your paths

> Show hidden files.
  • Start Terminal
  • Type "defaults write com.apple.finder AppleShowAllFiles true"
  • Type "killall Finder"
> Create a path file
  • Start TextEditor
  • Type "/usr/local/mysql/bin" into it and press return
  • Save As "MS." onto your desktop
  • Copy the file into the directory ROOT :: private :: etc :: paths.d
  • Click to authenticate this copy
  • Restart your computer

Configure MySQL

  • Run Terminal
  • Type "mysql -u root"
> You will now see the MySQL monitor start up and you should see the prompt "mysql>"

  • Type "drop database test;"
> You should see "Query OK, 0 rows affected (0.05 sec)" or similar
> Note replace <ROOT> with your root password

  • Type delete from mysql.user where User = '';
  • Type flush privileges;
  • Type set password for root@localhost = password('<ROOT>');
  • Type set password for root@127.0.0.1 = password('<ROOT>');
  • Type quit
> To re-enter MySQL we now need the password sp

  • Type "mysql -u root -p"
> You will now see the MySQL monitor start up and you should see the prompt "mysql>" again

> Now create the wordpress database

  • Type create database wordpress;
  • Type grant all privileges on wordpress.* to wpuser@localhost identified by 'foo';
> Now to add the password BUT this is different for Snow Leopard and PRE Snow Leopard……
>
> For PRE Snow Leopard:
  • Type set password for wpuser@localhost = old_password('wppass');
>
> For Snow Leopard:
  • Type set password for wpuser@localhost = password('wppass');
> We can now leave mySQL setup

  • Type quit
> Now to turn on PHP

  • Open the directory root :: private :: etc :: apache2
> Edit the configuration file

  • Double click "httpd.conf"
> You will be asked what application to open it with

  • select TEXT EDITOR
> Then

  • Scroll the page down till you find a line that start "#LoadModule php5_module ……."
  • Delete the hash
> We cannot just save the file as TEXT EDITOR does not have permission so

  • Goto File > Save As and save the file as httpd.conf on your desktop.
  • Now drag the file httpd.conf into the directory we opened earlier. (you will be asked to authenticate, say yes and then you will be asked for your password
> Install Word Press

  • Open the folder "Word Press" in your downloads folder
  • Open your Sites folder (located in your home folder)
  • Copy the CONTENTS of the Word Press folder INTO the Sites folder
> Setup Word press

  • Locate the file wp-config-sample.php
  • Right click this file and select "Open With" and select TEXT EDITOR
  • Goto File and select SAVE AS and save the file unchanged as wp-config.php
> Locate the following lines and change them as per these new versions:

define('DB_NAME', 'wordpress');
define('DB_USER', 'wpuser');
define('DB_PASSWORD', 'wppass');
define('DB_HOST', 'localhost:/tmp/mysql.sock');

  • Goto File and select SAVE then quit
> Restart Apache

  • Start Terminal
  • Type "sudo apachectl restart"
> RE-Hide hidden files.
  • Start Terminal
  • Type "defaults write com.apple.finder AppleShowAllFiles false"
  • Type "killall Finder"
 
Have you looked at running something like MAMP? I use it to test all my sites locally before uploading to a remote server.
 
Have you looked at running something like MAMP? I use it to test all my sites locally before uploading to a remote server.

I haven't, I haven't even looked at Word Press yet. I just did this tutorial because I knew that people have had problems. I will look at it as I can (y)
 
Well, MAMP is MySQL, Apache and PHP all wrapped up in a nice graphical GUI. No need for any command line config and you can get a suitable WordPress environment running in minutes. It includes a few tools such as phpMyAdmin to create databases and user privileges.

There are similar server packages available for Windows OS too e.g. WAMP, XAMP...
 
Well, MAMP is MySQL, Apache and PHP all wrapped up in a nice graphical GUI. No need for any command line config and you can get a suitable WordPress environment running in minutes. It includes a few tools such as phpMyAdmin to create databases and user privileges.

There are similar server packages available for Windows OS too e.g. WAMP, XAMP...

Arr right so what I have done here then :)
 
Darren, I've just started using WP and installed it via ftp on my web host, but, can I ask a potentially stupid question? Why should I want to run WP on my Mac?

If you are designing a site off line.
 
Well ok then! All I can say is that I have seen lots of people having WP installation problems so took time to do this. If there is a simpler option then go for it. If it does not work then this option is here.

I was going to carry this on with a look at the package itself after all the good stuff i've heard. I have not actually used it yet so if someone else wants to do that then even better.
 
I haven't, I haven't even looked at Word Press yet. I just did this tutorial because I knew that people have had problems. I will look at it as I can (y)

MAMP is probably the way to go with this. I managed to set my local wordpress install up with no issues whatsoever along the way.

To save you writing a tutorial, the instructions to do the are here http://codex.wordpress.org/Installing_WordPress_Locally_on_Your_Mac_With_MAMP

if a numpty like me can follow I assume most folks won't have too many issues
 
Last edited:
MAMP is probably the way to go with this. I managed to set my local wordpress install up with no issues whatsoever along the way.

To save you writing a tutorial, the instructions to do the are here http://codex.wordpress.org/Installing_WordPress_Locally_on_Your_Mac_With_MAMP

if a numpty like me can follow I assume mst folks won't have to many issues

Excellent, no need to re-invent the wheel. I had read lots about WP and wanted to have a look. When I searched I realised that lots of people had had problems so searched more and as I always do I wrote everything I did down step by step so I could re-create it if I wanted to. Once done I decided to publish it for everyone else. In reality the above instructions are not that complicated now they are written down do either way will do it but your link is probably a little easier :)

Anyway it's running now but I have only had a quick 5 minute play. Any decent tutorials on using it ?
 
WordPress is very well documented. So, it's worth starting with the Codex. It's probably the most detailed and comprehensive read, but perhaps not the quickest to get going with. If you're wanting to tinker under the hood then the Codex is the place to go.

WordPress itself is pretty intuitive to use. Especially, since v3 as a lot of the administration processes have been streamlined and using it as a content author is more friendly than ever before. Plugins and themes can be installed from within the admin back-end itself. No more browsing, downloading, unzipping, uploading.

For more specific help... Depends what you want to do with it. Although WordPress is synonymous with blogging, WordPress itself is incredibly flexible. Lorelle on WordPress is a must read if you really get into it.
 
Excellent, no need to re-invent the wheel. I had read lots about WP and wanted to have a look. When I searched I realised that lots of people had had problems so searched more and as I always do I wrote everything I did down step by step so I could re-create it if I wanted to. Once done I decided to publish it for everyone else. In reality the above instructions are not that complicated now they are written down do either way will do it but your link is probably a little easier :)

Anyway it's running now but I have only had a quick 5 minute play. Any decent tutorials on using it ?

the MAMP website and FAQ are great. I think they are probably the best sources of info on MAMP itself

http://www.mamp.info/en/documentation/faq.html

and

http://www.mamp.info/
 
I use MAMP on my Mac for testing all the sites I work on. Its certainly not the only way of doing things, but its one of the easiest. Its not without its quirks either, but again, for me, as someone more interested in creating and publishing content rather than tinkering away with commands and config files all over the place, its a godsend.
 
I found the official wordpress guide worked fine for me.
I've tried MAMP etc. but it's just more crap running on your machine IMO. google 'apache virtual hosts' and learn how to run multiple sites without resorting to MAMP.

Or, just use MAMP ;-)
 
Back
Top