I have run into a problem where I have been working with two different projects. One requiring Drupal and the other Laravel 7.+. There are more ways to setup a development enviroment then there are operating systems it seems! Today we will look at creating a well rounded development local server enviroment on a MacBook Pro using HomeBrew.

I especially enjoy using HomeBrew as it is an excellent package manager for OSX. Simple, straight forward and the packages are quite complete!

What I have to work with;

  • Processor Name: Intel Core i5
  • Processor Speed: 2.5 GHz
  • Number of Processors: 1
  • Total Number of Cores: 2
  • L2 Cache (per Core): 256 KB
  • L3 Cache: 3 MB
  • Hyper-Threading Technology: Enabled
  • Memory: 4 GB

As you can see, the machine is not a muscle machine by anymeans. It will work just fine for what I will be using it for.

According to the documentation, the minimum requirments are;

  • A 64-bit Intel CPU 1
  • macOS High Sierra (10.13) (or higher) 2
  • Command Line Tools (CLT) for Xcode;
    xcode-select --install, developer.apple.com/downloads

    or have Xcode 3 installed.

  • A Bourne-compatible shell for installation (e.g. bash or zsh)

Now, before you begin, you must not install HomeBrew as a root user! Very bad things can happen should you do so... You have been warned!

I like to create a work directory when using the commandline. I find it much easier to keep things clean.

mkdir ~/work && cd ~/work

Download and install HomeBrew with the installer;

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
chmod 775 install.sh && ./install.sh

The process should go off without a hitch. If you discover errors, it is best to fix the problems before you move on.

Now, I have a list of software I wish to install;

  • Apache 2
  • PHP 7.4 and extensions
  • MariaDB (MySQL replacement)

You will have to uninstall Apache from your system if you are using a newer version of OSX. Uninstall Apache.;

sudo apachectl stop &&
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Install Apache;

brew install httpd