The title sums up my issue. I’m deploying to shared hosting by uploading my files (except mylaravelproject/public/
to the root directory, and the contents of mylaravelproject/public/
to public_html/
.
I’ve already tried the following:
- Configuring
index.php
to point to the correct folder in root - Running
composer install
andnpm install
in the relevant directory php artisan key:generate
php artisan cache:clear
andphp artisan config:clear
composer dump-autoload
- Configuring
.env
and changing the relevant fields:APP_URL
and database related ones
I’m still met with a white screen and an HTTP 500 error. What should I do?
2
Answers
Whoops! I was able to solve it on my own somehow. Thanks to everyone who replied still.
For anyone having similar issues:
Start by adding the following to the top of
index.php
:Turns out hpanel / hostinger's directory structure is weird, and
public_html/
from the file manager is actually a shortcut to a folder not directly under root. Here's what it actually looks like:So unlike most guides out there, relevant directories under
index.php
need to be changed to something like__DIR__.'/../../../laravelinrootname/storage/framework/maintenance.php'
Enable debugger to know the issue
inside Config/App.php change
to
& in .env make
APP_DEBUG=
true