the php fopen fails to open a file for reading, if the file permission is 440. I don’t want to give 444 permission to the file, so that it can’t be accessed directly through a URL.
Share
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.
You can do as tj111 suggests, block it with .htaccess.
But even better idea is to put it outside of the www root.
For example if your PHP files are in /home/user/public_html/, put your files with limited access e.g. in /home/user/includes giving them 644 (
rw-r--r--). You can limit directory permissions to 711 (rwx--x--x), so no one but you can see what files are there. This doesn’t prevent you though, from reading or including these files using PHP.