I am pretty new in Laravel and I have the following doubt.
I have to migrate a Laravel 5.4 application that I have developed from my local environment to my remote server.
Can I do it in the following way?
Take the entire directory containing my local application and upload it into the /var/www/html directory of my remote server.
Export my local database and import on my remote database.
Change the content of the .env file.
Now the application should work on my remote server. Is it correct or am I missing something and I have to do something else?
here is the steps
Installation On Shared Hostings
Unzip the main zip file and upload your public_html folder ( upload vendor folder as well)
Give 777 recursive permission to storage/ and bootstrap/ folder
Create database in phpmyadmin and import .sql file
Set Database in .env file
index.php
Replace these lines with
require __DIR__."/../bootstrap/autoload.php";
$app = require_once __DIR__."/../bootstrap/app.php";
To
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
Add these line for setting public path
$app->bind('path.public', function() { return __DIR__; });
(Add this index.php)
Site is ready
Installation On Linux
Unzip the main zip file and upload your html folder (without vendor folder)
Give 777 permission to storage/ and bootstrap folder
ie (Linux: chmod -R 777 foldername
)
Done
you'll maybe have to update some packages on your remote server so Laravel can work properly. More details here : https://github.com/petehouston/laravel-deploy-on-shared-hosting/blob/master/README.md
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.