Danger of changing permission on public html folder???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tsg
Forum Contributor
Posts: 142
Joined: Sun Jan 12, 2003 9:22 pm
Location: SE, Alabama
Contact:

Danger of changing permission on public html folder???

Post 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
User avatar
Crashin
Forum Contributor
Posts: 223
Joined: Mon May 06, 2002 3:42 pm
Location: Colorado

Post 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. :)
tsg
Forum Contributor
Posts: 142
Joined: Sun Jan 12, 2003 9:22 pm
Location: SE, Alabama
Contact:

Post 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
User avatar
Crashin
Forum Contributor
Posts: 223
Joined: Mon May 06, 2002 3:42 pm
Location: Colorado

Post 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!
Post Reply