Search code examples
laravelsubdomainhostingq

Install Laravel on Sub Domain has Http 500 error


Having some real problems installing a Laravel App on a Bluehost[ed] subdomain. I get a 500 error and checked a number of web-resources and tutorials.

Here's what I've tried:

A) A simple FTP of the MyGreatApp to the main domain root, copying the MyGreatApp public folder in the public_html/subDomainName/ as suggested by "Deploy Laravel To Shared Hosting The Easy Way" (but with sub domain thoughts) https://www.youtube.com/watch?v=6g8G3YQtQt4

But I get a http 500 error.

B) A similar method using SSH and cloning a git repository which contains the Laravel boiler plate.

In each case the boilerplate Laravel app doesn't run. I can echo out of the index.php to let me know what I get to in the PHP.

Many tutorials suggest changing the paths (for subdomains) in the index.php file too as the public folder of the subdomain is buried differently to the public_html of the main domain.

We are using PHP 7.1 on bluehost and Laravel 7

Any thoughts to get a stage beyond the 500 error?

EDIT: The error is thrown after attempting to execute this part of the code...

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

Solution

  • We figured it out. It related to a problem with the dev PHP environment and the prod. PHP environment. PHP(Dev) > PHP(Prod) and a version issue in Symfony. When we downgraded Symfony to the "right" level of PHP it's fine.