我已经将laravel应用程序部署到共享主机。我的所有文件都位于public_html文件夹中,包括一个包含我的数据库凭据的.env文件。根据我在网上看到的一些文章,恶意用户可以通过某种方式访问public_html文件夹......这怎么可能,我该如何保护呢?
在project / public / index.php中
寻找以下内容:
require __DIR__.’/../bootstrap/autoload.php’;
$app = require_once __DIR__.’/../bootstrap/app.php’;
并将它们更新为:
require __DIR__.’/../project/bootstrap/autoload.php’;
$app = require_once __DIR__.’/../project/bootstrap/app.php’;
除非您正在上载供应商目录,否则您可能会遇到运行composer的问题。