title: php mkdir() chmod and permissions
body: <p>i was using this basic script:</p>
  
  <pre><code>$folderPath = "../path/to/$folder/";
  mkdir("$folderPath");
  </code></pre>
  
  <p>i create this directory and then upload photos to it. I've been doing this for a good 4-5 months now and suddenly i start getting 'FORBIDDEN' errors when I attempt to view the contents of the folder via web browser</p>
  
  <p>The directory is being created the same and the photos are still uploading without a problem, but I cannot access the photos</p>
  
  <p>I tried rewriting the script and using chmod to change the permissions but I'm having no luck at all</p>
  
  <p>All the older folders were being created with: -w- rwx r-x r-x</p>
  
  <p>and I can't get this recreated</p>
  
  <p>I've tried adding a chmod line into my script:</p>
  
  <pre><code>$folderPath = "../sales/inventory/$folder/";
  mkdir("$folderPath");
  chmod("$folderPath", 0755);
  </code></pre>
  
  <p>but I can't recreate the same permissions, I'm trying to understand how chmod works, but I can't figure out how to get this very basic function working properly again</p>