0

I've deployed a laravel app to a shared host. All my files are sitting within the public_html folder, including an .env file which contains my database credentials. According to some articles I've read online, the public_html folder is somehow accessible to malicious users...how is that possible and how can I protect it ?

1 Answers1

-3

In project/public/index.php

Look for the following:

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

And Update them to:

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

You Might Face problems running composer unless you are uploading the vendors directory.

Reference: https://medium.com/laravel-news/the-simple-guide-to-deploy-laravel-5-application-on-shared-hosting-1a8d0aee923e

PHP Geek
  • 3,949
  • 1
  • 16
  • 32