Page 1 of 1

Danger of changing permission on public html folder???

Posted: Fri Jun 25, 2004 8:48 am
by tsg
What is the danger of changing the permission to the public html folder??? if any.

What I am needing to do is create sub folders from a form, then create subdomains. (need to be done from a form. I can do it via FTP and WHM, but needs to be done by a user).

I can create subfolders to a subfolder (/home/whatever/public_html/folder/New_Sub_folder) because I have the "folder" CHMOD'd to 777. I need to create them in the /home/whatever/public_html folder.

Any suggestions?

Thanks!
Tim

Posted: Fri Jun 25, 2004 11:32 am
by Crashin
I don't know if it's possible, because I've never tried, but have you looked into having your script change the permissions on the folder while you're creating the new folder, and then changing them back when you're done? Maybe that's exactly what you're asking...

But, could you, instead of how you're going about it, just create a sub-folder that would contain the remainder of the user submitted sub-folders? So, instead of putting the user folders in the root directory, you could do something like:

/home/whatever/public_html/folder_you_specify/folders_created_by_users/New_Sub_Folder

That gets you around compromising your root directory. :)

Posted: Fri Jun 25, 2004 2:37 pm
by tsg
I was thinking about that this morning ... change the permission back and forth, but won't allow me to do that.

What permissions would I need to set the public_html folder to do so?


and the home/whatever/public_html/folder_you_specify/folders_created_by_users/New_Sub_Folder just won't work for what I am trying to do. I can do that now, but not what I need.

Thank you crashin

Posted: Fri Jun 25, 2004 3:02 pm
by Crashin
Hey tsg,

Well, I can't give you any code samples because I've never worked with directory permissions via PHP. But, check these out:

Working with the filesystem:
http://us2.php.net/manual/en/ref.filesystem.php

Your specific question, from Google:
http://groups.google.com/groups?hl=en&l ... 26rnum%3D1

Hope that helps!