0
votes

I deployed the contents of the "public" folder in my Laravel into the "public_html" folder in my host also deployed the rest of the folders into the "core" folder that I created next to the "public_html" folder. I changed the index.php file information in the "public_html" folder to this form:

require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';

to:

require __DIR__.'/../core/vendor/autoload.php';
$app = require_once __DIR__.'/../core/bootstrap/app.php';

And I also set up the database information in the env file. I checked my PHP version. I use Laravel 5.7 and my PHP version is 7.3.3

1
Check your laravel and apache/nginx log files. Add the actual stack trace (error) here.ege
Can you post the output of ls -h so we can see the owner and the permissions of the core folder?Pieterjan
check if you could ssh your server and excecute 'composer update' thereJose Palazuelos

1 Answers

0
votes

I think that the solution after we relocated the public folder is to change the index file as you have changed:

# These two lines should be changed...
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';

# ... into these two lines.
require __DIR__.'/../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../laravel/bootstrap/start.php';

then we should configure .htaccess inside your www folder this is the tree of www folder

config/
logs/
www/
    app/
    bootstrap/
    public/
        packages/
        .htaccess
        index.php
        ...
    vendor/
    ...

then inside .htaccess place the following .htaccess file.

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

Your Laravel application should now work.