0
votes

I have just deployed Laravel 5.4 using Composer on a shared hosting and I've run into several problems which I think are now fixed.

The first one was folder permissions which is now fixed so at least I see a welcome page.

I noticed that composer install never create a routes directory so I uploaded a local version and also it never creates a cache directory in the boostrap folder which I fixed also.

I have installed Laravel on a subdomain and I want everything to run through the subdomain as the root folder has a different application.

If i got to the subdomain, the welcome page opens as expected but as soon as I try to use a different route, I get this error:

NotFoundHttpException in RouteCollection.php line 145:

I have looked at what other people have done with subdomains but nothing works for me. I don't know if there are other files are missing during the install

This is what I have in the Routes.php

Route::group(['domain' => 'subdomain.example.com'], function () {
    Route::get('/', function () {
        return view('welcome');
    });

    Route::get('test', function () {
        return view('welcome');
    });
});

I assume every route needs to run in the subdomain route group or do I need to use this at all seeing as the install is in the subdomain directory and the vhost is pointing to the subdomain public folder

1

1 Answers

0
votes

It turned out to be a problem with the PHP version the command line was using on Plesk.

Currently Plesk runs in 5.4 and Laravel needed 5.6. For some reason Composer ran successfully and it seemed to miss downloading some of the files.

I wiped everything from the subdomain and thanks to this http://blogs.reliablepenguin.com/2015/08/18/using-php-composer-phar-with-non-default-php-install i was able to run composer using php version 5.6

I didn't need any special route for subdomains as everything is in the subdomain and these routes worked as expected

Route::get('/', function () {
    return view('welcome');
});

Route::get('test', function () {
    return view('welcome');
});