Sensitive credentials in Slim 4 project

Maybe I was using it incorrectly, but when I used vlucas/phpdotenv with more than 1 website on the same server, using different credentials or different databases, they seemed to overwrite each other.

So, if a request came in on the first website and then a request on the other website before the first request was completed, the creds from the second request would be used if they were needed in the first request, causing issues.

Because of this issue, I prefer to use a simple php array and I use selective/config to access the items. I use an example settings file and have composer or the user copy it for use.

I hope that answers at least part of your question.

1 Like