Is there a way to hide my password for database access in my config.php configuration file ?
What is the best way to do this ?
I want to hide to visitors and hosting’s admin 🙂
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t generally hide them because at some point they have to be read by the application using it in run-time. The better bet is to keep them secure so they don’t have a chance to be readable by anyone except you (or authorized personnel).
For example, your config.php should NOT be in a public or html directory that’s web accessible. If I go to website.com/config.php, I should not see the file produced (even if it would typically be blank). This is because sometimes PHP code is exposed when a configuration setting is off, and this could reveal the code that sets the password you’re trying to keep private.