php - How protect .env file laravel -
i move project host can access .env address mysite.com/.env , display file variables , secure data. .env file :
app_env=local app_debug=true app_key=base64:xxxxxxx app_url=http://localhost db_connection=mysql db_host=127.0.0.1 db_port=3306 db_database=xx db_username=xx db_password=secret cache_driver=file session_driver=file queue_driver=sync redis_host=127.0.0.1 redis_password=null redis_port=6379 mail_driver=smtp mail_host=mailtrap.io mail_port=2525 mail_username=null mail_password=null mail_encryption=null
how can hidden file ?and logical solution?
note : (i move files public folder in root directory.)
all except public folder move higher level, such folder laravel - http://prntscr.com/bryvu7
change file publi_html/index.php line
require __dir__.'/../bootstrap/autoload.php';
to
require __dir__.'/../laravel/bootstrap/autoload.php';
and line
$app = require_once __dir__.'/../bootstrap/app.php';
to
$app = require_once __dir__.'/../laravel/bootstrap/app.php'; $app->bind('path.public', function() { return __dir__; });
change file laravel/server.php line
require_once __dir__.'/public/index.php';
to
require_once __dir__.'/index.php';
Comments
Post a Comment