Chaiwat Jo
Chaiwat Jo

Reputation: 143

How to deploy laravel to server using ftp

Hi I'm newbie on Laravel. I have to upload laravel project to Linux server(CentOS). Customer provide me ftp path. For example 10.222.20.10/srp. So I put all files into that path and after edited database inside .env file. I run 10.222.20.10/srp on webbrowser but I getting error 'This page is not working, error 500'. I attached picture as below. Appreciated for advise and thank you very much.

ftp

error 500

Upvotes: 1

Views: 6449

Answers (2)

Tai Ho
Tai Ho

Reputation: 576

Please Follow this Steps:

1. Copy all contents inside the /project/public directory to project/ Remember to copy the public/.htaccess to the project/ also Now let’s modify the www/index.php to reflect the new structure. Don’t modify the project/public/index.php, okay? Only modify www/index.php, remember this!!!

Find the following line

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

And update them to the correct paths as following

require __DIR__.’/../project/bootstrap/autoload.php’;
$app = require_once __DIR__.’/../project/bootstrap/app.php’;

2. Set permision 777 project/storage and project/bootstrap/cache

Upvotes: 2

Puria Golgoon
Puria Golgoon

Reputation: 216

Please Follow this Steps:

1.public folder(index.php) is the start point of your application set

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

according to your configuration or use symlink

2.Migrate Database (if you don't have ssh access create a route and use Artisan facade Artisan::call("migrate"); and don't forget to remove it )

3.Link storage if you need (if you don't have ssh access create a route and use Artisan facade Artisan::call("storage:link"); and don't forget to remove it )

4.Check server logs maybe folder premissions is wrong.

Upvotes: 0

Related Questions