If you are new to Laravel and wanted to start with Laravel this article is very helpful for you. In this article I'm going to explain how you can install the Laravel on you System. Laravel have some requirements to work so make sure you meets with following requirements.
- PHP >= 7.0.0
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
After meeting these above requirements. Here are the steps to create your first project in Laravel.
1) Install composer
Install curl if you have not installed yet:
1
|
sudo apt-get install curl
|
a) Global Installation:
1
2
3
|
sudo curl -s https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
|
You can check composer by following command:
1
|
composer
|
b) Locally Installation:
1
|
curl -sS https://getcomposer.org/installer | php
|
2) Install Laravel
If you have installed composer globally:
1
|
composer create-project --prefer-dist laravel/laravel blog
|
If you have installed composer locally:
1
|
php composer.phar create-project --prefer-dist laravel/laravel blog
|
* blog is the project name, you can change it according to your project name
3) Give write permission to storage and bootstrap/cache folders
1
2
|
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
|
4) Generate APP_KEY and put it into .env file and command to generate APP_KEY is
php artisan key:generate