Fastest Way to install WordPress on OSX 10.10, 10.9, 10.8, 10.7 and 10.6

fastest-wordpress-install-osx-mavericks

This tutorial assumes a certain degree of comfort in the command line Terminal for installing WordPress on Mac OS X Yosemite, Mavericks, Mountain Lion or Snow Leopard, but the commands below are not overly complex and following the tutorial will get the job done. If you have no experience with the Terminal and want the easiest way to install on your local Mac then follow this guide here which installs everything with a point and click in the Finder.

Before proceeding WordPress needs a couple of things to get going and those things are an AMP stack  – Apache, MySQL and PHP, Apache and PHP come bundled in OS X but MySQL needs to be downloaded and configured. Optionally install phpmyadmin to manage the database.

To get the AMP stack working correctly on OS X follow this Mac OSX 10.10 Yosemite or OSX 10.9 Mavericks.

Once these components are in place you are OK to proceed.

OS X has 2 web document roots ‘/Library/WebServer/Documents’ and ‘/Users/username/Sites/’ also known as ‘~/Sites’ this guide uses  ‘~/Sites’.

The shared WordPress directory will be called “wordpress“.

WordPress File Set Up

make a sharing directory and move into it

 mkdir ~/Sites/wordpress ; cd ~/Sites/wordpress

get the latest WordPress

curl -O https://wordpress.org/latest.tar.gz

expand it

 tar -xvzf latest.tar.gz

move all files into shared directory one level up

mv wordpress/* .

remove empty directory and compressed archive

rmdir wordpress/ ; rm latest.tar.gz

create a settings file

cp wp-config-sample.php wp-config.php

Database Setup

create it a new database (no space between -p and password – as an alternative this can be done in phpmyadmin

mysql -u [username] -p[password] -e "create database [databasename];"

or in phpmyadmin

phpmyadmin-create-database

phpmyadmin-create-database

 

create-database-wordpress-phpmyadmin

create-database-wordpress-phpmyadmin

You can do all of the above in one hit at the command line just separate the commands with “;”. This would be handy with multiple installs and can be scripted – not necessary for this guide – but I thought I’d throw it in.

mkdir ~/Sites/wordpress ; cd ~/Sites/wordpress ; curl -O http://wordpress.org/latest.tar.gz ; tar -xvzf latest.tar.gz ; mv wordpress/* . ; rmdir wordpress/ ; rm latest.tar.gz ; rmdir wordpress/ ; rm latest.tar.gz ; cp wp-config-sample.php wp-config.php ; mysql -u [username] -p[password] -e "create database [databasename];" ; nano wp-config.php

WordPress Database Config

Then proceed with the editing of the wp-config file which needs to have the database details added as below:

nano wp-config.php

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘wordpress‘);

/** MySQL database username */
define(‘DB_USER’, ‘root‘);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘yourpassword‘);

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost‘);

If you are not comfortable with editing this file in nano in the Terminal you can use Text Edit in Applications.

Famous 5 Minute Install

open it up in your default browser

open http://localhost/~username/wordpress/wp-admin/install.php

fill in your credentials:

wordpress-fastest-install-osx

wordpress-fastest-install-osx

voila

wordpress-fastest-install-osx-success

success

Post Mortem

 

OSX Yosemite 10.10

In your username.conf in /etc/apache/users/ make sure you have the following directives:

This will allow .htaccess file usage.

But wait there’s more, you need to fix up those ownership and permissions

sudo chown -R _www ~/Sites/wordpress ; sudo chmod -R g+w ~/Sites/wordpress

Or just change the Apache user to be your regular user.

Thats it you should have a fully functioning local WordPress install built on a native AMP stack.

 

  • http://twitter.com/Dudikowski Abra Cadabra

    Thanks for this guide. I followed it and got my a WordPress site running in no time.
    But the installation is not 100% complete yet.

    I get a “missing temporary folder” error when I try to upload an image. I have really tried to google up some answers. There are a lot of threads about this but I just can’t find one that fix my problem. Have you seen this problem? How can I fix it?

    The second question is about the last part about “follow symlinks”. I would like to use clean urls. Am I supposed to have a .htaccess file inside the Sites/wordpress folder or in my Sites folder from the WordPress installation? I turned on invisible files in Finder but I have no hidden file in these folders (I have used .htaccess files before so I know what they are for).

    The link you provided shows a change in the usernam.conf file, not the .htaccess file. In another blog post I saw that Options +FollowSymLinks (with the plus sign) is for .htaccess but the same Options FollowSymLinks (no plus sign) is for Apache conf files, so your info looks mixed up. Could you clearify this please.

    http://www.maxi-pedia.com/FollowSymLinks

    • Anonymous

      You get the .htaccess file when you set your permalinks from within WordPress >> Settings >> Permalinks – then when you set a custom setting a .htaccess file is generated and stored in the root of the WordPress installation.

      In this file put the Option +Follow Symlinks line as posted.

      Regards the media library, see if this helps:
      http://coolestguyplanettech.com/wordpress-media-library-updates-not-working-osx/

    • Anonymous

      Line should be:

      Options +FollowSymLinks

  • Kdesrochers

    I want the WP site to be at the root of my domain not at ~administrator/wordppress. How would I go about doing that?

    • Anonymous

      The root level is at “/Library/WebServer/Documents”, just make that the install directory and is viewable at http://localhost/

  • Marco

    Hi. Could all this be done on Lion SERVER as well??
    Can we use the internal website/IP address that MAC provides locally, or do we need to redirect one of our parked domains to the Server??Running MAC Lion. With Lion Server Installed.I have a Drupal Site published (not content yet). It’s getting easier…I found a perfect WordPress Template I would like to use–which brought me to your site–I would like to develop it LOCALLY–THIS IS MY GOAL HERE…sorryHave Installed Ubumtu (too complicated).Using CPanel on my VPS Host (WAY too complicated).

    • http://coolestguyplanettech.com Neil Gee

      Yes you can run it locally – you will need a permanent external IP address from your ISP which will need to be port forwarded (port 80) to your server internal IP address from your local router

  • http://www.facebook.com/rance.costa Rance Costa

    Put the web hostname into the name field of the WordPress install.  If you have localhost in as the URL on the wordpress setup it will act like that.

  • Anonymous

    Hi, I’m running OSX Lion Server (only difference is the location of the sites folders which defaults to /library/server/web/sites/default) and managed to install MySQL and WordPress on my mini. One problem: sendmail doesn’t work any ideas what could be wrong? I only use the web and weddav server (mail server is disabled)

  • Glenn

    I had a problem connecting to my MySQL installation – it could not find /var/mysql/mysql.sock  I checked my install and it was using /var/tmp/mysql.sock so I created a sum link to point to the one MySQL was using and it now works :)

  • Steve Moore

    What is the web document root on OS X Server 10.7? I think it is /Library/Server/Web/Data/Sites/Default

    So is that where the wordpress directory should end up? /Library/Server/Web/Data/Sites/Default/wordpress
    —OS X has 2 web document roots ‘/Library/WebServer/Documents’ and ‘/Users/username/Sites/’ also known as ‘~/Sites’ this guide uses  ‘~/Sites’.

    • http://coolestguyplanettech.com Neil Gee

      yes it should be ok there

  • Pingback: MacMini server deel 14: Wordpress « AJvK.nl

  • Pingback: taplinlaw.biz » Blog Archive » Adding WordPress to OS X 10.7

  • Pingback: Installera wordpress på Mac OsX Server

  • Pingback: Installazione e configurazione di Apache, MySQL, PHP, phpMyAdmin e WordPress in OSX 10.8 Mountain Lion « Mad Mat

  • Pingback: https://plus.google.com/u/0/105422170127740092668

  • Pingback: DevMini #02. WordPress 설치 (OSX Mavericks, Postgresql) | LUBANG BLOG

  • Pingback: Thank You all for the help. | www.cossaboon.net

  • Pingback: DevMini.02 워드프레스 설치 (맥미니, OSX Server, MySQL) | LUBANG BLOG

  • Pingback: 关于网站一些有用的链接 – Les Misérables!