Reputation: 13
I am trying to create a folder for my user once they registered, however even though there is no error with the syntax it still does not want to create the folder. Do I need to edit any of my server php configurations?
$dirpath = "/users/".$username;
mkdir($dirpath);
Upvotes: 1
Views: 4036
Reputation: 163
Try
<?php
$dirpath = "/users/".$username;
mkdir($dirpath, 0700);
?>
The mode is 0777 by default, which means the widest possible access. For more information on modes, read the details on the chmod() page.
If you're working on Windows OS mode is ignored.
Upvotes: 1
Reputation: 3559
You need to make sure the directory "/users" is writable for whatever user your webserver is running as.
Upvotes: 0