php - stock passwords outside document root


In order to protect the passwords that I use to connect to mysql and to an smtp server, I thought of putting those passwords in a json file outside the document root and to run in the document root a json_decode();

Is this a safe solution? Or is it better to leave the passwords in a .php file somewhere in the document root?


People are also looking for solutions to the problem: How would I make an equivalent of this PHP line in bash?


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.