Laravel is one of the famous PHP Framework. Today, the latest version of Laravel is 5.1. In this article, we will explain how to install Laravel 5 on Mac OS X and MAMP from stratch.
Before we begin to install Laravel 5, we need to prepare the following matters.
MAMP (you can download it here)
PHP >= 5.5.9 (include in latest MAMP)
That’s all! Let’s get started!
1: Install Composer
First thing that we need to do is installing Composer. It help you to install Laravel 5 easily.
But what is composer? According to their website:
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
To install Composer, open Terminal and type the following command on terminal:
curl -sS https://getcomposer.org/installer | php
Please wait while Composer instaling. Then, to install Composer globally. Use this command:
mv composer.phar /usr/local/bin/composer
Verify the installation by running:
If you get list of composer command on your terminal with end line like this.
search Search for packagesself-update Updates composer.phar to the latest version.selfupdate Updates composer.phar to the latest version.show Show information about packagesstatus Show a list of locally modified packagessuggests Show package suggestionsupdate Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file.validate Validates a composer.json and composer.lock
Congratulation! Your Composer has been installed successfully.!
2: Installing Laravel 5
Go to MAMP’s htdocs folder by run the following command:
Next, we want to install latest stable version of Laravel 5.
composer create-project laravel/learn-laravel --prefer-dist
Note : you can change learn-laravel with a name that you prefer.
php artisan -V
If it show something like this
Laravel Framework version 5.1.20 (LTS)
That means Laravel 5 successfully installed. Congratulations!
Now we check the interface of Laravel 5 in the browser. Open the public folder by typing it in the browser.
We will see the Laravel 5 interface like this.
Congratulations! Laravel 5 successfully installed.