I have a piece of code that looks like this:
if($makeDir) {
mkdir($pathToRoot.$uploadDir);
}
I am receiving a warning "Permission Denied". How do I obtain permission for creating this directory?
Creating directory
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
If the directory is outside your web-root, you'll typically need to talk to the host, or do it manually within your control panel. If the directory is inside your web-root, when disallowed, your host has likely chosen to not give php that permission due to security concerns.
Are you sure the directory is correctly located and set?
Are you sure the directory is correctly located and set?
it also depends where the link is relative to.. I've noticed on a few of boxes that apache is only allowing mkdir to run when specifying the directory by relative link, rather than absolute path.. (also check you don't have a slash missing..
try just mkdir('testdir') and see where it ends up, then write a rel path to where you want
try just mkdir('testdir') and see where it ends up, then write a rel path to where you want