mkdir to a share!?!?!

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
terji
Forum Commoner
Posts: 37
Joined: Tue May 14, 2002 5:27 pm
Location: Denmark

mkdir to a share!?!?!

Post by terji »

I'm running php on a IIS.
Is it possible to create a directory on a share?

Code: Select all

mkdir("\\\\some\\dir&quote; 0700);
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Not 100% sure but I think you need to CHMOD the folder to 777 for public reading and writting.... might be wrong though.

Code: Select all

<?
$newDir = "public_stuff";
$setDir = mkdir($newDir, 0777);

if($setDir)
{
    echo "New Directory <b>{$newDir}</b> created.";
}
else
{
    echo "There was a problem creating the new <b>{$newDir}</b> Directory.";
}
?>
terji
Forum Commoner
Posts: 37
Joined: Tue May 14, 2002 5:27 pm
Location: Denmark

NOPE - didn't work!

Post by terji »

That didn't work - the mkdir returns false..

However this works:

Code: Select all

shell_exec("mkdir \\share\on\network");
BUT this only works on my test servers not on the live site :?

I'm guessing that this is a permissions problem - I've added Everyone, IUSR and IWAM to have full permissions but it still doesn't work....

:?: :?: :?:
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Hmmm... dunno then sorry. I'm an Apache/PHP man myself.
Post Reply