0

How can I change the chmod to 0777 through PhP for a folder with subfolders and all it's content!? Or if I set the chmod for the folder with the subfolders all the subfolders will have 0777 permission as well? Thanks :)

4
Contributors
8
Replies
10
Views
7 Years
Discussion Span
Last Post by JRM
0

Have you considered the security implications of giving the world and its dog complete and unfettered access to your system?

0

If you have a PHP manual and you look up chmod, then there it is. As mentioned however; setting it to 777 may not be the greatest idea.

0

I need to write many files in my script, so chmod 0777 is kind of necessary and also upload lots of images in the folder. I didn't know of any negative impact of this exactly.

Edited by seularts: n/a

0

I need to write many files in my script, so chmod 0777 is kind of necessary and also upload lots of images in the folder. I didn't know of any negative impact of this exactly.

PHP itself has access to everything.
I don't understand why you want the whole world scribbling in your files!
What EXACTLY is it that are you trying to do? Surely there is a better way!

0

my scripts writes and creates files in a folder and also uploads image files, so for writing and uploading i think i have to give permission 0777, don't I!?

0

my scripts writes and creates files in a folder and also uploads image files, so for writing and uploading i think i have to give permission 0777, don't I!?

No, that's what logins and user accounts are for.
If you do 777, you will become a hacker/spammers paradise. If it gets bad enough, you might even hear from the FBI.
Good luck!

0

Well yeah.. I didn't say I don't have security, I always regulate the traffic and access through .htaccess and cookies. But still, I can't write files or unlink them unless I'm making my folder 0777. The only way I could realize this so far was through ftp_chmod(), but this is not so convenient for a customer to input his ftp account data so he could rewrite his folder's access in ftp, this could be indeed considered a scam:P so, is there a way to chmod() a folder, because I'm out of luck so far!:(

0

.htacess? Now there's another thing that has a real down-side.
I only do database driven dynamic sites . It makes it a lot easier to securely deal with users. .htacess is almost a thing of the past! I avoid it like the plague.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.