Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
406 views
in Technique[技术] by (71.8m points)

php - Deploy Laravel 5 using only FTP in a shared hosting

I need to deploy a laravel 5 project to a client host.

The plan of my client is basic hosting: Linux + MySql without cpanel or similar (i.e. no admin panel).

I have access only via ftp and only to a folder named www.mycustomerweb.com. It means I can not create a directory at the same level of www.mycustomerweb.com folder. Only inside it (I think it is called shared hosting).

One year ago, I deployed a project made with Laravel 4 this way:

  1. got rid of public folder moving its content to root folder and updating index.php and bootstrap.php
  2. finished whole project in localhost (with Xampp)
  3. uploaded all files to www.myclientweb.com via ftp.

My questions are:

  1. Did I do everything all right with laravel 4 project? May I have fallen into security issues (I mean, is the site safe)?

  2. How do I deploy a laravel 5 project to the same site? In Laravel 5 I can not get rid of public folder as I did with Laravel 4.

Right now, I have set up a fresh installation of Laravel 5 on localhost and then I have uploaded all files to www.myclientweb.com folder via ftp:

Surely this is not the right way...

I've had a long searching through the web and Stackoverflow with no luck.

Really apprecite any help.

Thanks for reading.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  1. I create a new folder named "protected"
  2. Move all except "public" folder into "protected" folder
  3. Move all inside "public" folder to root
  4. Edit index.php in root folder(from public folder),

edit require __DIR__.'/../bootstrap/autoload.php'; into require __DIR__.'/protected/bootstrap/autoload.php';

also edit $app = require_once __DIR__.'/../bootstrap/app.php'; into $app = require_once __DIR__.'/protected/bootstrap/app.php';


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...