Laravel Framework – Installation & Setup
In this tutorial series I will be introducing PHP programs to the Laravel PHP Framework. Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern. At the time of this writing, Laravel is on version 5.3
Server Requirements
The Laravel framework version 5.3 has the following system requirements. Please make sure your server meets the following requirements before you attempt the installation:
PHP >= 5.6.4
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Installation:
Laravel utilizes Composer to manage its dependencies. So, before using Laravel, make sure you have Composer installed on your machine.
Using Composer Create-Project
You can install Laravel by issuing the Composer create-project
command in your terminal:
1 |
composer create-project --prefer-dist laravel/laravel YOUR_PROJECT_NAME |
Hint: Using Composer with verbose
flag.
The --verbose
or -vvv
flag will make sure Composer outputs more information with each operation it performs, helping you understand exactly what’s going on. This will come handy when debugging bottlenecks during your installations.
1 |
composer create-project --prefer-dist laravel/laravel YOUR_PROJECT_NAME -vvv |
The Application Key
Typically, this string should be 32 characters long. The key can be set in the .env
environment file as APP_KEY
. If the application key is not set, your user sessions and other encrypted data will not be secure!
If you installed Laravel via Composer or the Laravel installer, this key has already been set for you by the php artisan key:generate
command.
View Project
After installing laravel, you can view your new project using the links below
1 |
http://YOUR-DOMAIN/public/ |
For example, on localhost
1 |
http://165.227.127.66/PROJECT_NAME/public/ |
Hint: After the installation, you might find that you need to add read and write directory permissions especially in Linux environments.
For example: on Ubuntu
1 |
# apt-get chmod 777 -R /PATH_TO_PROJECT_DIRECTORY/PROJECT_NAME |

New Laravel Project
Folder structure
Public Directory
The index.php
in this directory serves as the front controller for all HTTP requests entering your application.
Configuration Files
All of the configuration files for the Laravel framework are stored in the config
directory. Each option is documented, so feel free to look through the files and get familiar with the options available to you.
Directory Permissions
After installing Laravel, you may need to configure some permissions. Directories within the storage
and the bootstrap/cache
directories should be writable by your web server or Laravel will not run.
Conclusion:
The is the end of part one, its very short but it will break or make your love for the Laravel Framework. If you encounter any issues, please feel free to leave me a comment below. Your can read Part II: Laravel Authentication. It will basically introduce basic http user authentication; login, register, reset lost password in Laravel.