anatak Posted May 11, 2014 Share Posted May 11, 2014 (edited) 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 May 11, 2014 by anatak Quote Link to comment https://forums.phpfreaks.com/topic/288394-grant-access-to-a-folder-outside-documentroot/ Share on other sites More sharing options...
Ch0cu3r Posted May 11, 2014 Share Posted May 11, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/288394-grant-access-to-a-folder-outside-documentroot/#findComment-1479083 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.