Mac OS X, Nginx, PHP-FPM, Mariadb specifics and blackfire
# For reference;
# Install: https://github.com/OzzyCzech/dotfiles/blob/master/how-to-install-mac.md
# Brew: https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/FAQ.md
# Start LEMP stack:
$ sudo nginx && launchctl load -w /usr/local/opt/php71/homebrew.mxcl.php71.plist && launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.blackfire-agent.plist && mysql.server start
# Stop LEMP stack:
$ sudo nginx -s stop && launchctl unload -w /usr/local/opt/php71/homebrew.mxcl.php71.plist && launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.blackfire-agent.plist && mysql.server stop
# NGINX config
$ cd /usr/local/etc/nginx
# VHOST Config
$ cd /usr/local/etc/nginx/sites-available
# NGINX log files
$ tail -f /Library/Logs/nginx/*
# Start NGINX
$ sudo nginx
# Stop NGINX
$ sudo nginx -s stop
# Reload NGINX
$ sudo nginx -s reload
# PHP-FPM executable
$ cd /usr/local/Cellar/php71/7.1.1_12/bin/php
# PHP-FPM Config
$ cd /usr/local/etc/php/7.0/php-fpm.d/www.conf
# PHP-FPM Ini files
$ cd /usr/local/etc/php/7.0/conf.d/
# PHP-FPM error log
tail -f /var/log/fpm-php.www.log
# Start PHP-FPM
$ launchctl load -w /usr/local/opt/php71/homebrew.mxcl.php71.plist
# ps. double check with $ ps gaux | grep fpm
# Stop PHP-FPM
$ launchctl unload -w /usr/local/opt/php71/homebrew.mxcl.php71.plist
$ which php (should show now like this; /usr/local/Cellar/php71/7.1.1_12/bin/php)
# Switch between PHP versions
# 7.0 --> 7.1
$ launchctl unload -w /usr/local/opt/php70/homebrew.mxcl.php70.plist && launchctl load -w /usr/local/opt/php71/homebrew.mxcl.php71.plist
# 7.1 --> 7.0
$ launchctl unload -w /usr/local/opt/php71/homebrew.mxcl.php71.plist && launchctl load -w /usr/local/opt/php70/homebrew.mxcl.php70.plist
# Start Mariadb
$ mysql.server start
# Stop Mariadb
$ mysql.server stop
# Project root
$ cd /Users/boywijnmaalen/Sites
# Change default Mac OS X PHP to Custom PHP Installation
$ which php (should show something like this; /usr/bin/php)
# open bash profile
$ vim ~/.bash_profile
# add the following;
export PATH=/usr/local/Cellar/php71/7.1.1_12/bin:$PATH
# reload bash profile
$ source ~/.bash_profile
# install Blackfire (with brew);
# Add the Blackfire repository:
$ brew tap blackfireio/homebrew-blackfire
# Install the blackfire-agent package:
$ brew install blackfire-agent
# Configure your Blackfire credentials:
$ sudo blackfire-agent -register
(it will ask you for your server id & server token; please go to; https://blackfire.io/account)
# Register the blackfire-agent service:
$ ln -sfv /usr/local/opt/blackfire-agent/*.plist ~/Library/LaunchAgents
# Then load it for the first time:
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.blackfire-agent.plist
# Run the config command to initialize the client:
$ blackfire config
(it will ask you for your server id & server token; please go to; https://blackfire.io/account)
# Run the config command to initialize the client:
$ brew install blackfire-php71
(for more info; https://blackfire.io/docs/up-and-running/installation)
# Start Blackfire
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.blackfire-agent.plist
# ps double check with $ ps gaux | grep blackfire
# Stop Blackfire
$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.blackfire-agent.plist