Quick permissions issue, expert opinion appreciated...

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
scarface222
Forum Contributor
Posts: 354
Joined: Thu Mar 26, 2009 8:16 pm

Quick permissions issue, expert opinion appreciated...

Post by scarface222 »

Hey guys, quick question. I have the following code in php that is supposed to create directories on my server

Code: Select all

mkdir("../../usercontent/$username",0666);
mkdir("../../usercontent/$username/images",0666);
mkdir("../../usercontent/$username/audio",0666);
mkdir("../../usercontent/$username/images2",0666);
The first one gets made (../../usercontent/$username) but the others say Permission denied. Also the first parent folder that gets made is made as 0644 permission instead of 0666 and is being created in a parent directory of 0755.

Anyone know what I can do and what would be the safest permissions for users uploading content and viewing it later?
Post Reply