Laravel 5.1在主机上上传 [英] Laravel 5.1 upload on host
问题描述
我已经使用 Laravel 5.1 php框架在我的本地XAMPP服务器上构建了一个Web应用程序.
I have used the Laravel 5.1 php framework to build a web application on my local XAMPP server.
- 哪些文件或文件夹应该上传到我的共享主机服务器上?
- 是否应上传根目录下的
.env
文件? - 在这种情况下,如果此文件中包含敏感信息(例如数据库连接密码),是否存在安全风险?
- Which files or folders should be uploaded on my shared host server?
- Should the
.env
file at root be uploaded? - In this case, if sensitive information such as database connection passwords are in this file, is there a security risk?
推荐答案
-
所有项目文件应在项目根目录
\var\www\project
下上传(项目=所有laravel项目文件夹和文件,而\var\www\project\public
是您的域指向的位置. 存储空间应具有写权限.
All project files should be uploaded under project root
\var\www\project
(project = all laravel project folder and files and\var\www\project\public
is where your domain pointing. Storage should have write permission.
.env
将位于项目根目录下,并且不能公开访问.
.env
will be under project root and it is not available for public access.
.env
将无法公开访问,如果这样的话,则说明您的Web服务器存在配置问题.
.env
won't be accessible for public, if it is then you have a configuration problem with you web server.
这篇关于Laravel 5.1在主机上上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!