Storing Database Security Credentials in PHP Securely -


is storing database credentials 1 relative-level in directory structure (../dbconn_inc.php) secure?

we have basic shared hosting account through godaddy runs cpanel, main page being stored in /public_html. hoping find simple solution securely store database credentials in php include file. have not changed folder permissions (yet - willing so). our primary methods of directory manipulation cpanel's directory manager , filezilla. @ moment, referencing include file stored in root directory (/), unsure if safe.

thank in advance!

it's reasonably safe keep database information inside of script, security of scripts dependent on host , how configure , work server.

the disadvantage keeping connection information inside of .php file hosted inside of web root if server stops parsing php , outputs script plain text user loading page, best keep database config outside of web root keep access restricted.

your directory this:

|-config |   --database.php | |-public_html (root www.mysite.com) |   --init.php  

then in init.php use require "../config/database.php" information needed.

extra info

this question has been asked before , has answers

alternative methods including outside web root


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -