I am writing a file upload using Zend_Form_Element_File(). I created a directory called users in the public directory. When I load the file, I got an error saying page is not found. I check the directory and saw that the permission is drwxr-xr-x. So I change the permission to drwxrw-rw- and load the page again. The page loads properly. But when I upload a file, it produces an error again. So I finally change the permission to drwxrwxrwx and everything runs properly.
My question is that am I doing the usual way that others are doing? I found it strange to make a directory executable.
Can someone explain whether I’m doing it correct? I am just learning Zend framework.
I am writing a file upload using Zend_Form_Element_File(). I created a directory called users
Share
Directories must be executable if a program should be able to “enter” it. Entering a directory basically means accessing any file/directory below that directory.
Having “read” access to a folder allows you to list its contents – what “write” access does is pretty obvious.
However, for security reasons you should check if
drwxrwx---(770) is not sufficient; often your user and the webserver share a common group. If that’s the case, there’s no need to give any access to “world”.It would be even better to run your scripts as the same user as you – by using fastcgi that wouldn’t be too hard, but if you are on shared hosting you usually do not have the necessary access to do this.