Skip to content

Instantly share code, notes, and snippets.

@josephdicdican
Last active July 3, 2018 05:38
Show Gist options
  • Save josephdicdican/806bc34dedf55bec0b6522d114c82465 to your computer and use it in GitHub Desktop.
Save josephdicdican/806bc34dedf55bec0b6522d114c82465 to your computer and use it in GitHub Desktop.
Local Development Env Setup (for mac users only)

1. Install mariadb for database

brew install mariadb

After install start mariadb

brew services start mariadb

Set default password to root user (substitute 'welcome' to your choice of password, but make it easy for this is only local setup)

mysqladmin -u root password 'welcome'

Test if can connect to root using newly set password

mysql -uroot -pwelcome

2. Install [email protected] using brew

brew install [email protected]

Start [email protected]

brew services start [email protected]

Check if correct php is running, should output php 5.6

which php

To make sure that [email protected] is always used when you execute commands with php, you need to add this to your paths.

Create .bash_profile file under ~ (~/.bash_profile)

cd ~
touch .bash_profile
open .bash_profile

Paste this on the .bash_profile file (content will differ if other php version is installed)

export PATH="/usr/local/opt/[email protected]/bin:$PATH"

To conclude the change, save it and run command below

source ~/.bash_profile

Test if [email protected] is your current php version used

which php
/usr/local/opt/[email protected]/bin/php <-- should output this

3. Install nginx (for test domain on local)

brew install nginx

Starting nginx, do command below

sudo nginx
Password: <input your machine password>

Stopping nginx

sudo nginx -s stop
Password: <input your machine password>

Local development is set now.

1. Install Sublime Text

Visit: https://www.sublimetext.com/3 Download and install dmg

After installation, open .bash_profile previously created and append this

alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"

Conclude change on .bash_profile

source ~/.bash_profile

To test go to your ~/Sites and open specific folder existing inside your Sites folder

cd ~/Sites
subl laravel

To open current directory,

cd ~/Sites/laravel
subl .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment