Jump to content


This topic is now archived and is closed to further replies.


File Permission Set Up for PHP database Passwords

Recommended Posts

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

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.


Share this post

Link to post
Share on other sites
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

[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:

[code]Order Deny,Allow
Deny from all
Allow from[/code]

Share this post

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

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.