Installing Laravel in OSX

Installing Laravel in OSX is not difficult, just follow the steps below

Install Homebrew

For the latest install command, visit http://brew.sh

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install PHP with Homebrew

Find PHP 7

brew search php7

Install PHP 7.3

brew install [email protected]3

Install mcrypt

brew install mcrypt

Install MySQL

brew install mysql

Install Composer

  1. Visit https://getcomposer.org
  2. Click Download
  3. Run the commands in terminal
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" 
php composer-setup.php 
php -r "unlink('composer-setup.php');"

Make Composer globally accessible

mv composer.phar /usr/local/bin/composer

Setup new Laravel App

Download laravel installer from composer and make it available globally

composer global require "laravel/installer"

Go to the directory you want to install your app

laravel new laravel-blog

Run a local development server

This will serve the the laravel-blog app at http://localhost:8000

php artisan serve
This entry was posted in Development and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *