Support the ongoing development of Laravel.io →
posted 9 years ago
Packages
Last updated 1 year ago.
0

Following this SO thread has worked for me on hostgator to install laravel in a subfolder on shared hosting.

(If it's your primary domain you can adjust the number of ../. Check your php error log if it's having problems finding files and then correct the path to resolve those.)

http://stackoverflow.com/questions/16683046/how-to-install-lar...

Basically upload your laravel project folder in to something like /laravel/

This will be in the directory above your /public_html/ folder.

Then modify these two files outlined below based on the details in the StackOverflow link above.

Finally, we need to edit 2 files: Laravel's /bootstrap/paths.php and /public/index.php.

In the paths.php file, replace:

'app' => DIR.'/../app', with:

'app' => DIR.'/../../laravel/app', In the paths.php file, replace:

'public' => DIR.'/../public', with:

'public' => DIR, In the paths.php file, replace:

'base' => DIR.'/..', with:

'base' => DIR.'/../../laravel', In paths.php, replace:

'storage' => DIR.'/../app/storage', with:

'storage' => DIR.'/../../laravel/app/storage', In index.php, replace:

require DIR.'/../bootstrap/autoload.php'; with:

require DIR.'/../../laravel/bootstrap/autoload.php'; In index.php, replace:

$app = require_once DIR.'/../bootstrap/start.php'; with:

$app = require_once DIR.'/../../laravel/bootstrap/start.php';

(Don't forget to update your database information)

Last updated 1 year ago.
0

Thanks for the long and detail reply. Hhmm pretty hassle....but will try it.

Appreciate it.

Hc.

Last updated 1 year ago.
0

I wouldn't recommend shared hosting for Laravel app. Shared hosting may be cheap, but it has security and performance issues. Since resources are shared with multiple users, this may affect the performance often. If a website on a shared server is experiencing sudden spike in traffic, this will affect the performance of other websites in the same server. Instead, I would recommend to use hosting, like DigitalOcean, instead. They are cheap and don't have performance and security issues like shared hosting. If you believe that hosting Laravel on DigitalOcean may be difficult, then try doing it using managed hosting platform, like Cloudways. Using their platform you can install Laravel on DigitalOcean in just a single click. https://www.cloudways.com/en/laravel-hosting.php

0

Sign in to participate in this thread!

Eventy

Your banner here too?

chanjay chanjay Joined 30 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.