Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

merys's avatar
Level 1

Illuminate \ Database \ QueryException (1045) - Why show DB_DATABASE,DB_USERNAME,DB_PASSWORD

Why laravel Illuminate \ Database \ QueryException (1045) show

Environment Variables APP_NAME "Laravel" APP_ENV "local" APP_KEY "base64:PgCIYu3SXIm+tzff/T+cxk3UFKPcfZS2o2szJIXmQ2w=" APP_DEBUG "true"

APP_LOG_LEVEL "debug"

APP_URL "http://localhost"

DB_CONNECTION "mysql"

DB_HOST "127.0.0.1"

DB_PORT "3306"

DB_DATABASE "apka"

DB_USERNAME "root"

DB_PASSWORD "secretpassword"

I want register new user in laravel project with php artisan migrate:make. Project run successfull on localhost when i copy files on vps and i don't configure files for test i have errors with view all Environment Variables. WHY ? Laravel exeption show this data. For easy hack ? How can secure this ...

0 likes
2 replies
tykus's avatar
APP_ENV=local
APP_DEBUG=true

should be

APP_ENV=production
APP_DEBUG=false
merys's avatar
Level 1

thx tykus im new and laravel is my first framework

Please or to participate in this conversation.