This tutorial assumes a certain degree of comfort in the command line Terminal for installing WordPress on macOS Sierra or Mac OS X El Capitan, Yosemite, Mavericks, Mountain Lion or Snow Leopard, 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 an easier way to install WordPress on your local Mac then consider using an already compiled set up, which allows for quick and easy multiple WordPress sites, like Desktop Server .
“Google Tag Manager for WordPress” has been translated into 5 locales. Thank you to the translators for their contributions. Translate “Google Tag Manager for WordPress” into your language. Interested in development? Browse the code, check out the SVN repository, or subscribe to.
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.11 El Capitan or 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
get the latest WordPress
expand it
move all files into shared directory one level up
remove empty directory and compressed archive
create a settings file
Database Setup
create it a new database (no space between -p and password – as an alternative this can be done in phpmyadmin
or in 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.
WordPress Database Config
Then proceed with the editing of the wp-config.php file which needs to have the database details added as below:
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘wordpress‘);
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘wordpress‘);
/** MySQL database username */
define(‘DB_USER’, ‘root‘);
define(‘DB_USER’, ‘root‘);
/** MySQL database password */
define(‘DB_PASSWORD’, ‘yourpassword‘);
define(‘DB_PASSWORD’, ‘yourpassword‘);
/** MySQL hostname */
define(‘DB_HOST’, ‘localhost‘);
define(‘DB_HOST’, ‘localhost‘);
![Wordpress Wordpress](/uploads/1/2/6/0/126099865/678537190.png)
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
fill in your credentials:
voila
success
Post Mortem
OSX El Capitan 10.11
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
Wordpress Manager For Os X 2
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.
If you are having install issues possibly because of previous file configurations do try a solution like Desktop Server, it is a free app up to a level and then paid for some pro features.
The easiest way to install various Unix tools and open source software onto Mac OS X is via a package manager, unfortunately OS X doesn’t come with one, but fortunately there are some good folks that care. They come in the form of Homebrew.
Homebrew isn’t the only option, also available is MacPorts and Fink but Homebrew is the newest and most popular of the trio.
Get Xcode
Get Xcode 7 .
Download and install it, you also need to open Xcode agree to the license and it will install its components.
Get Command Line Tools
Install Homebrew
To download install Homebrew run the install script on the command line as below and let the script do its thing:
After installing and as suggested in the command line, to check for any issues with the install run:
To search for an application:
To install
To list all apps installed by Homebrew
To remove an installed application
To update Homebrew
To see what else you can do
Where does Homebrew install stuff …. in the Cellar
Where the brew lives.
Updating from previous OSX Version
If you are updating from a previous OSX version you may run into file permission issues with El Capitan’s new SIP process .
To get around this you can change ownership on the Homebrew directory