ProfessorGT
ProfessorGT

Reputation: 205

403 forbidden when permission are 777

I have a script on my server that is trying to access the uploaded folder on my server. When I run the script I'm getting a 403 forbidden error when the script tries to access the uploaded folder even though I have the permission set for uploaded to be wwww-data:www-data and 777. Any thoughts?

Thanks in advance!

Upvotes: 2

Views: 4763

Answers (1)

Nacho
Nacho

Reputation: 386

Check the permissions on the whole path.

If you want to access /dir1/dir2/dir3/file, you need read permissions on file, but also execute permissions on dir1, dir2, and dir3.

Permissions work a little different for directories than for files. Write permission means you can create files in that directory. Read means you can list the files in that directory. Execute means you can use that directory as part of a path.

In this case, if the permissions for that specific file are correct, then you need to check the directories that make up the path.

Alternatively, it could be an Apache config issue, but I would check the directories first.

Upvotes: 3

Related Questions