title: move_uploaded_file(): Unable to move
body: <pre><code>$targetFolder = '/LP/media/image'; // Relative to the root
  
  if (!empty($_FILES)) {
      $tmpName = $_FILES['Filedata']['tmp_name'];
      $targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
      //$ext = end(explode('.', $_FILES['Filedata']['name']));
      $targetFile = rtrim($targetPath, '/') . '/' . $_FILES['Filedata']['name'];
  
      // Validate the file type
      echo $targetFile;
      $fileParts = pathinfo($_FILES['Filedata']['name']);
      $fileTypes = array('jpg', 'jpeg', 'png','JPG','JPEG','PNG'); // File extensions
      if (in_array($fileParts['extension'], $fileTypes)) {
          move_uploaded_file($tmpName, $targetFile);
          //echo '1'.$fileParts['filename'];
          // echo $fileParts['filename'];
  
          $aimage = file_get_contents($tmpName);
  
         // echo '&lt;img src="data:image/jpeg;base64,' . base64_encode($aimage) . '" width=\'100\' height=\'100\' /&gt;';
      } else {
          echo 'Invalid file type.';
      }
  }
  ?&gt;
  </code></pre>
  
  <p>Same code is working on my local machine, but deployed on remote server. Then getting below error.</p>
  
  <blockquote>
    <p>/home/username/public_html/LP/media/image/default_avatar.png<br />
    <b>Warning</b>:  move_uploaded_file(/home/username/public_html/LP/media/image/default_avatar.png): failed to open stream: No such file or directory in <b>/home/username/public_html/uploadify/gallery.php</b> on line <b>28</b><br /></p>
    
    <p><b>Warning</b>:  move_uploaded_file(): Unable to move '/tmp/phpoe0fBd' to '/home/username/public_html/LP/media/image/default_avatar.png' in <b>/home/username/public_html/uploadify/gallery.php</b> on line <b>28</b><br /></p>
  </blockquote>