2

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.

Danijel
  • 817
  • 1
  • 17
  • 31
  • 500 is usually a syntax error. You may be trying to deploy to an old version of PHP that doesn't have some new language feature the app is trying to use. Also, egad, don't use perms of 777. – Alex Howansky May 31 '17 at 15:55
  • For 777 i know :) I used just to be sure that rights don't take any count on it. Real right to be used will be 0755 for folders and 0644 for files after this fix :S. It works on php 5.6.4 and 5.6.34 I use 5.6.30 will do another check but should be fine. – Danijel Jun 01 '17 at 06:02
  • What version of laravel are you using, I have Laravel Framework 5.4.24 and I do not find the file you mean with the wrong paths: "laravel/bootstrap/cache/config.php" – Marin Jun 05 '17 at 16:43

1 Answers1

3

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.

Danijel
  • 817
  • 1
  • 17
  • 31