DB connect script out of WWW folder, but can not open.

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
lafflin
Forum Contributor
Posts: 123
Joined: Thu Jul 26, 2007 6:26 pm

DB connect script out of WWW folder, but can not open.

Post by lafflin »

I am trying to leavde my DB Connect script out of my WWW folder for security reasons, but It seems that I am unable to open the file by way of "require_once" when I try to call it. I am somewhat of a beginner and have not actually done this yet. i am using a default install of WAMP for development if that matters at all. Am I missing something here?
Festy
Forum Commoner
Posts: 28
Joined: Wed Jan 30, 2008 10:01 pm

Re: DB connect script out of WWW folder, but can not open.

Post by Festy »

Can you post your code here?
User avatar
Mordred
DevNet Resident
Posts: 1579
Joined: Sun Sep 03, 2006 5:19 am
Location: Sofia, Bulgaria

Re: DB connect script out of WWW folder, but can not open.

Post by Mordred »

Should be able to, either by adding the non-www directory to the include path in php.ini, or by including with ../../blabla

You must know that this doesn't add much protection (it adds *some*) - for example local file include vulnerabilities may still be able to expose the file. Check this out for other options:

http://shiflett.org/articles/shared-hosting
Post Reply