How to Upload Laravel Project to Free Hostinger

Im gonna tell you how to upload our laravel project by free hostinger (000webhost). First of all we have to sign up to 000webhost here.

Create new website.

1.JPG

Create new database.

11.JPG

Open our laravel project folder, and create new folder. Move all folder and files in our laravel project to new folder except public.

5.JPG

Make zip from public and new folder.

4.JPG

Upload our laravel project zip to 000webhost.

2.JPG

There will be 3 folder on our root, Public_html, laravel, and tmp.

3

Upload public zip to public folder and also laravel zip to laravel folder.

7.JPG

Extract both of zip and move files to correct path. Ater that open public_html/index.php and change loader script with correct path

require __DIR__.’/../bootstrap/autoload.php’;

to

require __DIR__.’/../laravel/bootstrap/autoload.php’;

and

$app = require_once __DIR__.’/../bootstrap/app.php’;

to

$app = require_once __DIR__.’/../laravel/bootstrap/app.php’;

12.JPG

then go to laravel/.env and change db name, db username, and also db password with our current db name on 000webhost.

13.JPG

after that go to laravel/config/database.php and change all data for database correctly as well

14.JPG

last step is change env key at laravel/config/app.php

from ‘key’ => env(‘APP_KEY’),

to ‘key’ => ‘your app key from .env file’,

15.JPG

then walah, your laravel project is ready with free hosting

done.JPG

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s