Hi,
I'm working on a php script which will run on an web host. The script will have to accepts new images... The image will be resized and the being putted in the normal directory... ie : ~/images/
What I'm currently wondering about is : My user is not necessary in the same group than the webserver. So, the webserver won't be able to save the image in the folder I want unless I chmod 757 the directory where I want to put the image inside.
So, I think it's not a very good idea to give full access to other. Is there any better way to achieve a good security and being able to save the image in the right folder keeping a safe chmod (at most 755?)
Thank you for the advice!
Weeb!
Folder rights to put image into
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Folder rights to put image into
The next best thing to do would be to create a group for this and put both your user and the webserver user in that group. Set the images directory to be that group and give group access.
(#10850)
Re: Folder rights to put image into
If you have root access to the server follow arborint's advice.
If not:
- chmod 0777 web_root_directory;
- write a simple "create-a-directory" php script and browse to it in order to create a directory owned by apache user (e.g. web_root_directory/uploads);
- chmod 0755 web_root_directory;
This way you'll have web_root_directory/uploads owned by Apache user and it will be 0755
If not:
- chmod 0777 web_root_directory;
- write a simple "create-a-directory" php script and browse to it in order to create a directory owned by apache user (e.g. web_root_directory/uploads);
- chmod 0755 web_root_directory;
This way you'll have web_root_directory/uploads owned by Apache user and it will be 0755
There are 10 types of people in this world, those who understand binary and those who don't