Jump to content

grant access to a folder outside DocumentRoot


anatak

Recommended Posts

I am developing a site where all the user data is in a separate folder.

The idea is to not have to access the database with the user data. The account page will include the user data from the user that is logged in.

the problem however is that you can access all the user data by browsing to the right url

 

my folder setup is now
/DocumentRoot

and under DocumentRoot I have

 

public_html

scripts

user_data

 

by browsing to mydomain.com/user_data/user_1/account_1.inc

the user data is displayed as a regular text file.

the same thing is true for the scripts folder.

 

by placing the user_data and scripts folder outside DocumentRoot acces is denied to the user_data and scripts folder but then php can not include the needed files.

Is there some way to let php access the files in the user_data and scripts folders but in such a way that you can not access the files from a browser ?
 

Edited by anatak
Link to comment
Share on other sites

 

 

by placing the user_data and scripts folder outside DocumentRoot acces is denied to the user_data and scripts folder but then php can not include the needed files.

That shouldn't affect PHP as it uses the file system to access files, not Apache.

 

If PHP cannot access the file then it is either a file permission issue or an open_basedir restriction.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.