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.phpto point to the correct folder in root - Running
composer installandnpm installin the relevant directory php artisan key:generatephp artisan cache:clearandphp artisan config:clearcomposer dump-autoload- Configuring
.envand changing the relevant fields:APP_URLand database related ones
I'm still met with a white screen and an HTTP 500 error. What should I do?
CodePudding user response:
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:
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
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:
/
| - domains
| - yourdomainname.com
| - public_html
| - index.php
So unlike most guides out there, relevant directories under index.php need to be changed to something like __DIR__.'/../../../laravelinrootname/storage/framework/maintenance.php'
CodePudding user response:
Enable debugger to know the issue
inside Config/App.php change
'debug' => env('APP_DEBUG', false)
to
'debug' => env('APP_DEBUG', true)
& in .env make APP_DEBUG= true
APP_ENV=local
APP_DEBUG=true
