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
https://forums.phpfreaks.com/topic/78232-solved-mkdir-issue/
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
https://forums.phpfreaks.com/topic/78232-solved-mkdir-issue/#findComment-395941
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.