Last active
April 9, 2018 05:09
-
-
Save boywijnmaalen/deccc69937e7be544bd2603e59e60fbc to your computer and use it in GitHub Desktop.
Mac OS X, Nginx, PHP-FPM, Mariadb specifics and blackfire
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment