2

I have a shared hosting service hostinger. as I can upload my laravel 5.2 and configure project?

and I tried using:

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider {
/**
 * Bootstrap any application services.
 *
 * @return void
 */
public function boot() {
    //
}

/**
 * Register any application services.
 *
 * @return void
 */
public function register() {

    $this->app->bind('path.public', function () {
        return base_path() . '/public_html';
    });
   }
}

but still nothing.

3
  • Possibly dublicate ... stackoverflow.com/questions/25724586/… Commented Apr 7, 2016 at 12:21
  • I have done successfully at Godaddy. Commented Apr 7, 2016 at 12:23
  • not duplicate, are different versions of laravel :) Commented Apr 7, 2016 at 12:31

2 Answers 2

3

I guess easiest and better approach in this situation will be creating of a symlink between public_html and public folders. Example for Ubuntu/Debian:

ln -s /path-to-pub/public_html /path-to-pub/public

This solution is better because when you'll decide to move your project to VPN, dedicated server etc., you will not need to remember about any modifications you made and rewrite any code.

Sign up to request clarification or add additional context in comments.

2 Comments

thank you for the advice. as I do the distribution of the laravel project folders?
If you have /home/user543/public_html directory structure, for example, upload your Laravel files into user543 directory. So public_html and public directories will be in the same directory (on the same level).
1

Put this code:

$app->bind('path.public', function () {
    return base_path() . '/public_html';
});

to bootstrap/app.php and You are good to go. (I assuming that You renamed public directory already.)

2 Comments

I put all my project folders inside public_html?
No. Just rename public directory to public_html if public_html is your document root.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.