Jump to content


Photo

File Permission Set Up for PHP database Passwords


  • Please log in to reply
4 replies to this topic

#1 Lenbot

Lenbot
  • Members
  • Pip
  • Newbie
  • 5 posts
  • LocationSt. Thomas, ontario

Posted 19 June 2006 - 02:46 PM

Hello all
I have always been in control of my server and could put the database password in a safe secure location, out side of the website directory. Now I don't have access to the server and I have to set up File permission to do so, except you can't find anything online or I don't know what I am looking for. I need to have a Folder inside my main directory with a dbpass.inc File that only the script I run can have access to it and No one else. I have literally tried a million combinations and I give up, I need help I don't know what the Hell I am doing it is all greek to me.
I have 3 sets of options

Owner
Group
Public
each with permission to
Read [] Write [] Excute []

I need to know the right combination to put on the folder, and on the file so I can include the file where I need it but the public can't see it or reach it in any way.

Thanks for all the help, I assume it's something I might have to do in PHP I honestly have no clue, please help and its highly appreciated for any help anyone gives me.

cheers
-Lenbot

#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 19 June 2006 - 03:16 PM

I think CHMOD is not the solution. PHP won't access the files as "Owner", so 600 won't be of any good. Maybe try 660, but that probably won't work either.

I'd secure the folder with .htaccess

Check:
[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=96195&hl=deny\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...c=96195&hl=deny[/a]

I use:

Order Deny,Allow
Deny from all
Allow from 127.0.0.1

~ D Kuang

#3 Lenbot

Lenbot
  • Members
  • Pip
  • Newbie
  • 5 posts
  • LocationSt. Thomas, ontario

Posted 19 June 2006 - 05:34 PM

ya the website won't allow me to upload the .htaccess file. buggers. anyone else have any other ideas it must be possible

#4 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 19 June 2006 - 06:04 PM

What is the format of the database?
~ D Kuang

#5 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 19 June 2006 - 07:36 PM

If this is a hosting company, you can put it outside the public_html folder and it won't be accessible to the public, but you should be able to link to it through an include or require using the absolute path.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users