Installing Drush on MacOSX with Composer
- Open the Terminal app on your Mac. Install Homebrew via the instructions here: 3. Install Composer globally on your Mac with this command: brew install composer. If your computer doesn’t have a “/usr/local/bin” directory, create that first with this command: sudo mkdir -p /usr/local/bin.
- Noting: that many would argue running composer locally on your macOS is not a good idea. You should be running it in a VM or container that matches your production environment's stack configuration. 2 things need to be done here: 1) for people compiling composer locally on macOS Catalina, add the library see: Stackexchange topic.
This tutorial helps you to install and configure PHP composer on macOS operating system. Shell access to a running macOS; PHP 5.3 or higher version must be installed; 2. Install Composer on macOS. Download composer binary file from getcomposer.org website by running the following command.
In order to install Drush, you should first install Composer. Composer is often required for Drupal 8 and once Composer is installed, installing Drush is easy.
1. Open the Terminal app on your Mac.
2. Install Homebrew via the instructions here: https://brew.sh/
3. Install Composer globally on your Mac with this command:
brew install composer
4. If your computer doesn’t have a “/usr/local/bin” directory, create that first with this command:
sudo mkdir -p /usr/local/bin
…that creates the directory; you should be prompted to enter your computer’s password.
Now, when you type composer --version
and press Enter, we’ll see that you have Composer installed!
5. Install Drush via Composer:
Note!: Please do not install Drush using composer global require
. See Pantheon’s article, Fixing the Composer Global command.
Instead, first install the Composer global require
command:
composer global require consolidation/cgr
6. Add the vendor/bin
from the Composer home directory to your $PATH.
(Thereafter, you may substitute cgr
for any command line tool whose installation instructions recommends the use of Composer global require. Example: cgr drush/drush
)
If you get a popup to install the Xcode Developer tools, go ahead and install Xcode.
7. Update the system $PATH:
vim ~/.bash_profile
to edit the file press the i
key to enter Insert mode
…next, copy and paste this into that file:
export PATH='$HOME/.composer/vendor/bin:$PATH'
PATH='$(composer config -g home)/vendor/bin:$PATH'
Press the Escape (esc) key to switch back to command mode.
Type :wq
and press Enter to save and quit the file.
8. Quit the Terminal app (or, run the “source” command to load the .bash_profile file without having to restart the Terminal.)
To run the source command:
Install Composer Macos Catalina Download
source ~/.bash_profile
9. Now you will actually install Drush:
Install latest stable Drush:
cgr drush/drush
Now if you type drush
and press Enter, you’ll see that Drush is installed, and working on your machine!
Introduction
Laravel is a free and open source web framework written in PHP. It is created by Taylor Otwell. It follows MVC development approach. As of March, 2015, Laravel is regarded as one of the most popular PHP based framework. It provides advanced alternative to CodeIgniter which is not intended to built-in user authorization. In this tutorial, we will install Laravel on MacOS.
Prerequisites
- MacOS
- XAMPP
- Login as an administrator on terminal
- PHP >= 7.0.0
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
- login as a root user into the terminal
- Composer
Installation
Installation includes following steps.
1) Verify composer
Verify that composer is installed globally on the system by typing composer on terminal.
2) Install Laravel with Composer
A simple command needs to be executed in order to install Laravel on MacOS.
3) Edit bash profile
To run Laravel globally on terminal, we need to edit bash profile. Type the following command to open bash-profile in vieditor.
And add the following line to the file.
Source the file by using following command.
4) Create new Application
Now, we can run Laravel globally on our terminal. We need to run following command for this purpose.
Install Composer Macos Catalina Update
This will create an application named as mylaravel inside the home directory of current user.
5) Start the server
Laravel provides its own server which needs to be started in order to access Laravel on localhost. First, we need to change the directory by typing cd mylaravelon terminal and then Run the following command to start the server.
6) Access on localhost
Install Composer Macos Catalina Free
We can just simply type localhost:8000 to access Laravel on browser.
Hence, we have installed and get started with Laravel.