Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

stratboy's avatar

Where's bootstrap/paths.php? Or, how to setup paths for shared hosting?

Hi, I'm currently try to run a really small Laravel app on a shared hosting (Apache +nginx, but configured as apache). It's a good shared though, I can use shell and can access root. So, I currently have

/laravel (I uploaded the main app files here)

/laravel.example.com (the app will be served from here, and here I placed laravel's public folder contents)

By following a tut, I was looking at bootstrap/paths.php to change the public path on a 'public' property. But guess what? On Laravel 8 there's no bootstrap/paths.php file :)

So what? How to run a Laravel app on a shared host keeping the core app on the root (for security reasons)?

0 likes
3 replies
stratboy's avatar

Thank you, I'll take a look.

By the way, this community is super, and that's one of the reasons I'm currently falling in love with Laravel.

stratboy's avatar
stratboy
OP
Best Answer
Level 5

So I was able to setup my remote shared host env by partially follow the guides above but remaining in my original directory setup. Anyway, basically, the main thing one has to do, is just modify some directory paths in php files... So, how I did:

/laravel (I uploaded the main app files here) <<< please note that you can name it whatever you want

/laravel.example.com (the app will be served from here, and here I placed laravel's public folder contents, including original .htaccess) <<< please note that laravel.example.com is fake: put just any domain you want

Then:

  • Obviously, update db connection parameter and upload db content

  • on /laravel/server.php > change the following paths:

__DIR__.'/public'.$uri
__DIR__.'/public/index.php

To these:

__DIR__.'/../laravel.example.com'.$uri
__DIR__.'/../laravel.example.com/index.php'
  • on /laravel.example.com/index.php > change the following paths:
__DIR__.'/../storage/framework/maintenance.php'
__DIR__.'/../vendor/autoload.php'
__DIR__.'/../bootstrap/app.php'

To these:

__DIR__.'/../laravel/storage/framework/maintenance.php'
__DIR__.'/../laravel/vendor/autoload.php'
__DIR__.'/../laravel/bootstrap/app.php'

Done. All it's working fine for now.

1 like

Please or to participate in this conversation.