Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Hayden Shaw at the SilverStripe Christchurch Meetup

18 views

Published on

OS X Local Environment Powered By HomeBrew’s Apache

Published in: Software
  • Be the first to comment

  • Be the first to like this

Hayden Shaw at the SilverStripe Christchurch Meetup

  1. 1. OS X Local Environment Powered By HomeBrew’s Apache E2 Digital Hayden Shaw shaw.hayden@gmail.com @haydenshaw
  2. 2. Introduction Developing web applications on macOS is pretty painless - there are many options to get a local environment up and running. Just to name a few: ● MAMP ● Vagrant ● Docker (*)
  3. 3. MAMP I spent most of my early years as a developer using MAMP. MAMP gives you a nice and simple UI which sits over over Apache, PHP and MySQL. However you get to point where it becomes rather restrictive, starts to slow down or more frustratingly becomes out of date.
  4. 4. Vagrant Vagrant is an open source tool for managing virtual environments. These environments are usually virtual machines. Vagrant is run with another tool like Virtual Box. Allows you to spin up virtual machines that are exactly the same every time.
  5. 5. Never satisfied One of the drawbacks of using Vagrant is you have to run an entire virtual machine to run your application. This is very resource intensive and can take a long time to set up and run the provisioning script.
  6. 6. Join the Community Slack Channel https://www.silverstripe.org/community/slack-signup
  7. 7. What is Homebrew? It’s a command line package manager for macOS and will help you install all the stuff you need that Apple didn’t. It's all Git and Ruby underneath and you can even install apps, fonts and plugins with it.
  8. 8. It conveniently installs everything within its prefix and your Homebrew installation can live whenever you like. This all aids you to maintain a clean and up to date system and tap into a universe of open source utilities.
  9. 9. Fantastic tutorial ● Covers multiple PHP versions, MySQL, Apache virtual hosts and even Xdebug installation. ● Takes roughly an hour to get setup. ● Constantly updated during new OS X releases. https://getgrav.org/blog/macos-mojave-apache-multiple-php- versions
  10. 10. Virtual hosts $ open /usr/local/etc/httpd/extra/httpd-vhosts.conf
  11. 11. PHP version switching $ sphp 5.6 $ sphp 7.0
  12. 12. Maintenance Brew makes it super easy to update PHP and the other packages you install. The first step is to update Brew so that it gets a list of available updates: $ brew update
  13. 13. This will spit out a list of available updates, and any deleted formulas. To upgrade the packages simply run: $ brew upgrade $ brew update
  14. 14. Upsides ● It’s free ● Actively maintained ● Has its own self diagnostic tool (brew doctor) ● Thousands of packages/formulas to leverage
  15. 15. Downsides ● Recommended for experienced web developers ● Not a plug and play solution for your team ● Requires some maintenance sometimes around OS X updates
  16. 16. Happy brewing Hayden Shaw shaw.hayden@gmail.com @haydenshaw

×