Skip to content

Instantly share code, notes, and snippets.

@bdone
Forked from shrop/brewStack.md
Last active December 18, 2015 19:48
Show Gist options
  • Save bdone/5835202 to your computer and use it in GitHub Desktop.
Save bdone/5835202 to your computer and use it in GitHub Desktop.
# brewstack install
### Install steps:
* Install Homebrew
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install git
$ brew install homebrew/php/php56
$ brew install mariadb
$ brew install homebrew/php/php56
* Edit apache conf @ /etc/apache2/httpd.conf
# Listen: Allows you to bind Apache to specific IP addresses ...
Listen 127.0.0.1:80
# Dynamic Shared Object (DSO) Support
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
<IfModule unixd_module>
User {username}
Group admin
</IfModule>
# Deny access to the entirety of your server's filesystem ...
<Directory />
AllowOverride All
Require all granted
</Directory>
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf
* Edit php.ini
git clone https://gist.github.com/bdone/4e4cb3a57ad2ade34ef4 /tmp/php-ini
mv /tmp/php-ini/php.ini /usr/local/etc/php/5.6
* Edit my.cnf
git clone https://gist.github.com/bdone/588830a0bbca84915f56 /tmp/my-cnf
mv /tmp/my-cnf/my.cnf /usr/local/etc/my.cnf.d/my.cnf
* Install composer/dev-tools
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
composer global require drush/drush:dev-master
chsh -s /bin/zsh
## Security:
* Make sure Apache and MariaDB are not accessible outside of your Mac
* Make sure that new vhosts only listen to 127.0.0.1. Same goes for any port.
* Block all incoming connections to /usr/sbin/httpd using the OS X Firewall settings in System Preferences
- - -
$ sudo apachectl restart
$ mysql.server start
- - -
* Install additional php extensions (Optional. Follow configuration instructions after each install.)
$ brew install php56-apc
$ brew install php56-intl
$ brew install php56-memcache
$ brew install php56-mongo
$ brew install php56-uploadprogress
$ brew install php56-xdebug
$ brew install php56-xhprof
* If you want to use memcache or mongodb, make sure to install the cooresponding services
$ brew install memcached
$ brew install mongodb
# brewstack upgrades
### Upgrade steps:
$ brew doctor
$ brew update
$ brew upgrade
Composer updates
$ composer global update
Re-register Drupal and DrupalPractice Standard with PHPCS
$ phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer
Setup symlink to /etc for php exec() calls where "Configuration File (php.ini) Path" needs a value, and is PHP default of "none". This is used in migrate drush calls.
$ sudo ln -s /usr/local/etc/php/<PHP.VERSION.NUMBER>/php.ini /etc/php.ini
If updating a PHP version number, update the LoadModule call:
# /etc/apache2/httpd.conf
# To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/opt/php55/libexec/apache2/libphp5.so
Edit php.ini if upgrading PHP version
/usr/local/etc/php/5.<PHP.VERSION.NUMBER>/php.ini
For MSSQL dev:
$ brew reinstall php5<PHP.VERSION.NUMBER> --with-msssql
Install additional php extensions from fresh install steps below.
Add symlink for remote mysql/mariadb connections, via SSH tunnel:
ln -sf /usr/local/Cellar/mariadb/<MARIADB.VERSION>/lib/plugin/dialog.so /usr/local/mysql/lib/plugin/dialog.so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment