Jump to content


Photo

grant access to a folder outside DocumentRoot


  • Please log in to reply
1 reply to this topic

#1 anatak

anatak

    Advanced Member

  • Members
  • PipPipPip
  • 403 posts
  • LocationJapan, Fukuoka prefecture, Kitakyushu City

Posted 10 May 2014 - 08:28 PM

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, 10 May 2014 - 08:31 PM.

takasi.8008@docomo.ne.jp
tourokum@0508.jp

#2 Ch0cu3r

Ch0cu3r

    Advanced Member

  • Moderators
  • 2,013 posts

Posted 11 May 2014 - 07:59 AM

 

 

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.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com