Jump to content

[SOLVED] mkdir issue


sinus

Recommended Posts

I am using the  script below to create new folders

 

projectID = 1;
$oldumask = umask(0);
$mypath = "public/projects/$projectID";
mkdir($mypath, 0777, TRUE);
umask($oldmask);

 

The the folder is not being created in the projects folder and I get no error messages.

I have chmod the projects folder to 0777 so I should be able to write to it.

The really only thing I am doing strange is that the script trying to create the new folders is located

in public/content_management/.

The public folder is the one that my ISP create and everything in there is access on the web.

 

Any help would be great.

 

 

Link to comment
Share on other sites

I tried your code on my locahost (using wamp) and added one line

 

$server_path = $_SERVER["DOCUMENT_ROOT"];
$projectID = 256;
$oldumask = umask(0);
$mypath = $server_path . "/" . $projectID;
mkdir($mypath, 0777, true);
umask($oldmask);

 

and it works for me!  Try that or maybe define your path as a constant

 

~Mike

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.