How to upload an Laravel project to the server

Asked

Viewed 419 times

0

I did some things to test Laravel, I did everything on my localhost with Xampp and Composer, now I need to go up to Dreamhost and I’m not getting it, when I try to access the project on Dreamhost I get an error code 500, I went up the whole project, including the folder "vendor", to go up to Dreamhost I just changed the file ".env" changing the following fields:

APP_URL=http://localhost

DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

I changed the above fields with the Dreamhost data.

Can you help me ? What other modifications do I have to make? Remembering that I am accessing the project at the Dreamhost url plus the folder "public/", example: "http://projetolaravel.com.br/public/", and receiving error 500

2 answers

0

Friend, take everything inside the public folder of the server, and put it in the public folder of the server, which will be public_html or www ...

The rest goes one level higher. Configure the database in . env

Go to the index.php file in the public folder and look for this line of code.

$app = require_once __DIR__.'/../bootstrap/app.php';

Below it put the following code.

$app->bind('path.public', function() {
    return __DIR__;
});

This will tell the Standard what the public folder is. I already put this code in the skeleton that I use in all projects.

At you;

0


Problem solved! It was a simple thing, I had to change my version of PHP on the Dreamhost server, I was with PHP 7.0 and I switched to PHP 7.2!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.