title: PHP mkdir() failing to work
body: <p>Here's my code; I've renamed the directories, obviously. ;)</p>
  
  <pre><code>$thepath = "/var/www/vhosts/sub.domain.co.uk/web/apps/storage/".$userclient."/evidence/".$scid."/".$doctype."/";
  $testdir = is_dir($thepath); 
  if ($testdir == false) {
      mkdir($thepath, 0777);
  }
  </code></pre>
  
  <p>In this case, the following variables apply;</p>
  
  <pre><code>$userclient = '000';
  $scid       = '9263';
  $doctype    = 'Insurance Policy';
  </code></pre>
  
  <p>So, the path should be;</p>
  
  <pre><code>/var/www/vhosts/sub.domain.co.uk/web/apps/storage/000/evidence/9263/Insurance Policy/
  </code></pre>
  
  <p>I know this works, EVERYWHERE else in my code, I have other applications using an almost identical setup. But the one above, appears to be tripping up on /evidence/ - it sets the permissions to 755, but will then create the directories per time I run the code, if I set evidence to 777 (Octal).</p>
  
  <p>I get the following error message using;</p>
  
  <pre><code>if (!@mkdir($thepath)) {
      $error = error_get_last();
      echo $error['message'];
  }
  mkdir(): No such file or directory
  </code></pre>
  
  <p>Any help would be greatly appreciated, I have to finish this application by Thursday - and this file upload part is the last bit!</p>
  
  <p>Thank you!</p>