Coolest Guides on the Planet

coolest guides on the planet

Coolest Guides On The Planet

  • Home
  • macOS
  • WebDev
  • All Posts
  • Contact

Set up AMP Stack for Local Development in OSX 10.9 Mavericks with Homebrew

March 23, 2014 15 Comments

OSX ships with Apache and PHP but not MySQL, you can use HomeBrew to install the other parts of the AMP Stack quickly including MySQL,  phpMyAdmin and mcrypt. What you need to get started as a base is Xcode and Command Line Tools.

This guide is intended for those with more experience with the command line and the AMP stack  and want it done quickly – there is another guide here with more detailed instructions  for a more traditional installation and an introduction here to HomeBrew and Xcode.

This guide works best on clean OSX images with no previous AMP installs, but it will still work on ones with installs, but there may be bumps on the way.

Lets get started…

Base Tools

Install Xcode

Download and install Xcode

Install Command Line Tools

From the Terminal run…

xcode-select --install

 Install HomeBrew

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"

MySQL

Install MySQL

brew install mysql

Start mysql

mysql.server start

To login

mysql -u root

Set the MySQL root password – keep single quotes around password

/usr/local/mysql/bin/mysqladmin -u root password 'yourpasswordhere'

To make it launch on reboot

mkdir -p ~/Library/LaunchAgents

ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents

Apache

To start it

sudo apachectl start

To stop it

sudo apachectl stop

To restart it

sudo apachectl restart

Document root is  found at –

http://localhost/

Document root filing system at –

/Library/WebServer/Documents/

To set up User webroot see here.

PHP

Turn on PHP

sudo nano /etc/apache2/httpd.conf

Use “control” + “w” to search within nano and search for ‘php’ this will land you on the right line then uncomment the line (remove the #):

LoadModule php5_module libexec/apache2/libphp5.so

Write out and Save using the nano short cut keys at the bottom ‘control o’ and ‘control x’

Reload Apache to kick in

sudo apachectl restart

 

phpMyAdmin

Create symbolic link for mysql.sock

sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

Install phpMyAdmin

brew install josegonzalez/php/phpmyadmin

Add to your your httpd.conf

sudo nano /etc/apache2/httpd.conf

Add at the end…

Alias /phpmyadmin /usr/local/share/phpmyadmin

<Directory /usr/local/share/phpmyadmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Set Up Configuration

mkdir/usr/local/Cellar/phpmyadmin/4.1.4/share/phpmyadmin/config
chmod o+w  /usr/local/Cellar/phpmyadmin/4.1.4/share/phpmyadmin/config

Go to browser -> http://localhost/phpmyadmin/setup/

In the Authentication Tab set the password to the same one set as the MySQL root user from earlier

Login -> http://localhost/phpmyadmin/

mcrypt – optional

Make sure php.ini has its own config file

sudo cp /etc/php.ini.default /etc/php.ini
brew install php54-mcrypt

Edit php.ini to point to new extension directory and extension – if you already have set a extension directory then move mcrypt.so into it.

sudo nano /etc/php.ini

Add in and save

extension_dir="/usr/local/Cellar/php54-mcrypt/5.4.26/"
extension=mcrypt.so

Restart Apache

sudo apachectl restart

 

wget – optional

brew install wget

Other Installs

There are many packages to install with HomeBrew – just do a search…

brew search

 

Cats: macOS, WebDev

Tags

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls

Donate a Beer to the Coolest Guides

Get Beaver Builder Now!

Discuss

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls
Get DesktopServer

Lynda

Lynda.com Online Training Videos

TreeHouse

smlinks

Learn WordPress
osx-modify-shell-path

How to Add to the Shell Path in macOS Big Sur and Catalina using Terminal

October 19, 2019

virtual-hosts osx 10.10 yosemite

Set up Virtual Hosts on macOS Catalina 10.15 in Apache

October 19, 2019

Installing Homebrew on macOS Catalina 10.15, Package Manager for Linux Apps

October 18, 2019

Where is the bash shell in macos Catalina?

October 12, 2019

Refine your search

  • All
  • Modules
  • Themes
  • Documentation
  • Forums & Issues
  • Groups

RSS ars technica

  • Spotify seizes the day after Apple is forced to allow external payments
  • Apple and Meta furious at EU over fines totaling €700 million
  • After market tumult, Trump exempts smartphones from massive new tariffs
  • Apple silent as Trump promises “impossible” US-made iPhones
  • Apple enables RCS messaging for Google Fi subscribers at last

RSS mac surfer

  • Tot is new text editor for Mac, iPhone, and iPad focused on constraints and ease of use
  • TiPbITS: Google Drive Sorting Can Hide New Documents
  • How to take a screenshot on a MacBook Pro
  • How To Create Simple Animation With Mac Keynote
  • Last Week on My Mac: Virus pandemics

Donate

Copyright © 2025· Neil Gee - All Rights Reserved - Hosted by Runcloud

Copyright © 2025 · gee on Genesis Framework · WordPress · Log in