title: how to fix issue file_exists function in php always return false
body: <p>I am using PHP and I am trying to rename a file using <code>file_exists()</code> function, but the code always execute else case, although the file already exists.<br>
  Here is my code: </p>
  
  <pre class="lang-php prettyprint-override"><code>if(file_exists('../media/imgs/books/'.$_POST['old_name'])){
      rename('../media/imgs/books/'.$_POST['old_name'],'../media/imgs/books/'.$_POST['book_name']);
  }
  else {
      echo "file not found";
  }
  </code></pre>
  
  <p>When I execute this code, it always returns false and shows me "<em>file not found</em>".<br>
  Can anyone help me with this issue?</p>