MKDIR Troubles

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
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

MKDIR Troubles

Post by LiveFree »

Hello,

I seem to be running into an odd issue. A previous coder was able to create directories sucessfully by using:

Code: Select all

$dir = 'pending/' . date('l \\t\h\e jS \of F Y g:i  a').'/'; 
mkdir($dir);
And yet I cant make a dir using

Code: Select all

mkdir('/members/Test/');
mkdir('/members/Test/cp/');
mkdir('/members/Test/profile/');
The 3 dirs I am trying to create are the test dir, test/cp, and test/profile

Any reason why example #1 works but #2 doesnt?

BTW- Example #2 is based in the doc root.
User avatar
waradmin
Forum Contributor
Posts: 240
Joined: Fri Nov 04, 2005 2:57 pm

Post by waradmin »

Isnt there not supposed to be a trailing /?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: MKDIR Troubles

Post by volka »

LiveFree wrote:BTW- Example #2 is based in the doc root.
meaning?

/members/Test/
the leading / makes it an absolute path in the local filesystem. Is there a directory members in the server's root directory? (root != document_root)
Post Reply