Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-08-2010, 09:03 AM   #1
Registered: Nov 2010
Posts: 35

Rep: Reputation: 0
Safest place to put database connection file

When connecting to a database in a php script, where would be the safest place to store the connect.php file. I am thinking it should not be in public_html, but is it safe in sub folders or is there a method people generally use to keep such files secure and inaccessible.

The file I mean is one including the database name, user and password etc.
Old 12-08-2010, 09:04 AM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Completely outside of your webroot, so above public_html. Though I'm not sure if the other files will then be able to access it. Try it!
Old 12-08-2010, 01:56 PM   #3
Registered: Nov 2010
Posts: 35

Original Poster
Rep: Reputation: 0
Thanks, I have put it in the directory "above" public_html. It is working ok from there and I assume that it is completely inaccessible to anyone except account ftp user from there.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
The .c file of kernel source code where TCP connection takes place. indrajeetmopari Linux - Kernel 2 02-12-2008 07:52 PM
rhel put kerberos headers in wrong place Ratclaws Linux - Enterprise 0 12-09-2005 12:57 PM
Best place to put new programs. swamprat Linux - Newbie 5 10-04-2005 09:45 PM
best-practice place to put shared directories funaroma Linux - Newbie 1 11-30-2004 04:50 PM
what is the standard place to put sourcefiles and where install? ldp Debian 5 05-14-2004 11:36 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:15 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration