I have a php program which reads data from a file. [The data file is in a different folder]. In this scenario, how will i get 403 Error (Forbidden) while executing the program/reading the data from the file.
Thanks..
How to make a file/folder as forbidden (http status - 403)
Moderator: General Moderators
The folder doesn't have execute (traverse) permissions, or the file doesn't have read permissions for the user the script is executing under.
Research
Research
Code: Select all
chmod();Not sure if this will cause any problems as I haven't tried it myself, but in the directory you wish to protect, create (or modify existing) .htaccess file:
Code: Select all
<Directory /path/to/dir>
Order Deny,Allow
Deny from all
</Directory>