问题
I have some problems with deploying app to a shared host.
What i did till now:
- copy all public files to public_html/website/my-api
- copy all laravel system files to public_html/laravel
- checked rights
- corrected my-api/index.php require and require_once to a laravel/bootstrap/autoload.php
- laravel logs are empty no data in
- apache logs are empty no data in
- my webhosting is Hetzner hosting
After some debugging it crashes here:
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
I get Error 500 and no other information. I double checked right etc. they are 777. It's just crash with error 500.
EDIT1:
I checked .php version and on localhost it works with 5.6.25 i tested with 5.6.35 and it's ok too.
I investigate it further. It seems to crash at Application.php ::207 line
$this->make($bootstrapper)->bootstrap($this);
$bootstrapper has value -> "Illuminate\Foundation\Bootstrap\RegisterProviders"
If anybody knows more.
回答1:
I found out that paths in my App were incorrect.
It was developed on windows so path folders were \ but than after migrating to production server (Linux) could not open anything. So changing my custom includes (require_one calls) with \ -> / finally app worked
I came to this error after checking
public function render($request, Exception $exception) in my App/Exception/Handler.php
and putting var_dump($exception) finally printed what was going on. If it will help to anybody else.
Thanks to answer: https://stackoverflow.com/a/32714318/1861519 which pointed me to a Exception handler.
EDIT1:
One more hint, for a shared hosting if you don't have SSH (to run artisan/composer), check laravel/bootstrap/cache/config.php Paths were incorrect there.
EDIT2:
Big thanks got to: https://stackoverflow.com/a/33652169/1861519 For right configuration of custum public folder.
来源:https://stackoverflow.com/questions/44289354/laravel-crash-on-init-with-error-500-no-additional-info