in my public_html folder, I have some code like this:
echo file_get_contents('files/123.txt');
Users can view text files from a subfolder. But, is it possible using apache to block incoming requests to the files folder via browser?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In your Apache configuration, you can add:
http://httpd.apache.org/docs/2.4/mod/core.html#directory
I believe allowing file_get_contents is a PHP concern, not an Apache concern.
But once you do this, make sure to remember to restart Apache!