The simple guide to deploy Laravel and Lumen application on shared hosting.

For a quick version of the guide (many of you might already read about it), read my post on medium, "The simple guide to deploy Laravel 5 application on shared hosting"

Requirements

Before trying to deploy a Laravel application on a shared hosting, you need to make sure that the hosting services provide a fit requirement to Laravel. Basically, following items are required for Laravel 5.2:

PHP >= 5.5.9

OpenSSL PHP Extension

PDO PHP Extension

Mbstring PHP Extension

Tokenizer PHP Extension

Well, it also depends on the Laravel version you want to try to install, checkout the appropriate version of Laravel server requirements documentation.

Next, you need to have the SSH access permission for your hosting account; otherwise, none of these will work.

Besides PHP and those required extensions, you might need some utilities to make deployment much easier.

Git Composer

I guess that's enough for good. Please refer to below sections to learn more about deployment.

Instruction

Let's get started by understanding how we should organize the Laravel application structure. At first, you will have this or similar directories and files in your account,

.bash_history
.bash_logout
.bash_profile
.bashrc
.cache
.cpanel
.htpasswds
logs
mail
public_ftp
public_html
.ssh
tmp
etc
www -> public_html

...

For the main account which tied with the main domain, the front-end code should stay in public_html or www. Since, we don't want to expose Laravel things (such as, .env, ...) to the outside world, we will hide them.