Server(cPanel) .env file changing its values back to default
on the server my laravel app is not working fine for a while but then later the .env contents changes back to the default values.
what could be the cause of this?
@munyamakudzai095
There would be many reason that can happen. Checklist following:
Check Auto Backup/Restore is enabled.
Check GIt is init & .env file is in .gitignore & you are not making changes on GIt.
Incorrect File Permissions : Ensure that the .env file has the correct permissions set. It should ideally be readable and writable by the server process but not accessible to the public. Improper permissions could result in the file being modified or replaced.
@munyamakudzai095
CI/CD Configuration: Your CI/CD pipeline might have specific build or deployment steps that overwrite the .env file with default values. Check your CI/CD configuration files (e.g., YAML files) to see if there are any explicit commands or scripts modifying the .env file.