問題描述
我需要將 Laravel 5 項目部署到客戶端主機.
I need to deploy a laravel 5 project to a client host.
我的客戶的計劃是基本托管:Linux + MySql 沒有 cpanel 或類似的(即沒有管理面板).
The plan of my client is basic hosting: Linux + MySql without cpanel or similar (i.e. no admin panel).
我只能通過 ftp 訪問,并且只能訪問名為 www.mycustomerweb.com 的文件夾.這意味著我無法在 www.mycustomerweb.com 文件夾的同一級別創(chuàng)建目錄.只有在里面(我認為它被稱為共享托管).
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).
一年前,我以這種方式部署了一個用 Laravel 4 制作的項目:
One year ago, I deployed a project made with Laravel 4 this way:
- 擺脫了將其內容移動到根文件夾并更新 index.php 和 bootstrap.php 的公共文件夾
- 在本地主機(使用 Xampp)完成整個項目
- 通過 ftp 將所有文件上傳到 www.myclientweb.com.
我的問題是:
我在 Laravel 4 項目中做的一切都好嗎?我是否陷入了安全問題(我的意思是網站安全)?
Did I do everything all right with laravel 4 project? May I have fallen into security issues (I mean, is the site safe)?
如何將 Laravel 5 項目部署到同一個站點?在 Laravel 5 中,我無法像在 Laravel 4 中那樣刪除公共文件夾.
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.
現在,我已經在本地主機上全新安裝了 Laravel 5,然后我通過 ftp 將所有文件上傳到 www.myclientweb.com 文件夾:
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:
- 我可以在 http://www.myclientweb.com/public 看到 laravel 的歡迎頁面.
- 我在 http://www.myclientweb.com/ 看不到任何內容
- 而且我還可以在 http://www.myclientweb.com/.env 看到 .env 內容???????
- I can see wellcoming page of laravel at http://www.myclientweb.com/public.
- I can not see anything at http://www.myclientweb.com/
- And also I CAN SEE .env CONTENT AT http://www.myclientweb.com/.env ???????
這肯定不是正確的方法...
Surely this is not the right way...
我在網絡和 Stackoverflow 上搜索了很長時間,但沒有運氣.
I've had a long searching through the web and Stackoverflow with no luck.
真的很感激任何幫助.
感謝閱讀.
推薦答案
L4 和 L5 沒有區(qū)別,所以做和 L4 一樣的事情.
There is no difference between L4 and L5, so do the same thing you did for L4.
這篇關于在共享主機中僅使用 FTP 部署 Laravel 5的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!