Jump to content

how to store main settings.php file to be safe


php_guest

Recommended Posts

I have DB password and other important information stored in settings.php. I will put settings.php outside public directory.

 

But what I am not sure about is that I use to require_once settings.php into every page (index.php, users.php, profile.php, login.php, ...). Is that safe? I was thinking that if somebody came into any single main file, he will find out where I store setttings. If this file wouldn't be included in this way, than this won't be happen in any file.

 

So for example file users.php starts like this:

 

require_once(thePathName/settings.php');

checkLogIn(1);

require_once $_SERVER['DOCUMENT_ROOT'].'/languages/lang_'.$language.'.php';

 

...

if somebody came into any single main file

 

If someone has direct access to one of your files, they have access to all of them and it does not matter where you put your included files.

 

Is that safe?

 

What makes you think php including files it needs is not safe? There are 10's of millions of php based web sites including files now.

Archived

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

×
×
  • Create New...

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.