[RESOLVED] Make a directory is an existing directory?
I am unable to make a new directory in an existing directory that is one level up from where my script is located. Here's my folder structure:
I've tried using chdir("../clients") prior to running mkdir("./newfolder") but I get some strange error. Is that even how I should do this?
> [WHERE I WANT TO CREATE A FOLDER]
Racking my brain on this one...
It would help to tell us what the "strange" error is.
Without knowing, all I can do is guess that it's a permissions issue, which is often the case when you set up your site using your host login account, but then your PHP scripts are executed by the Apache account. Thus you may have to set read/write/execute for all on the directory where you want your script to create the directory -- which may have security ramifications, so choose wisely where you want this to happen in your directory tree.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
I'm using a MediaTemple Gridserver (shared). The error I receive when i try to use the absolute path is:
Here's the code I'm using:
Warning: mkdir(): open_basedir restriction in effect. File() is not within the allowed path(s): [GS-BIN PATH HERE] in [SCRIPT PATH HERE]script.php on line 21
When I use ./newfolder instead of newfolder I get an already exists error. Not sure what the correct syntax is. All folders have 777 permissions.
Typo was causing the error, first sign I need to take a break
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread