title: How to delete a file via PHP?
body: <p>How do I delete a file from my server with PHP if the file is in another directory? </p>
  
  <p>Here is my page layout:</p>
  
  <ul>
  <li><code>projects/backend/removeProjectData.php</code> (this file deletes all my entries for the database and should also delete the related file)</li>
  <li><code>public_files/22.pdf</code> (the place where the file is located.) </li>
  </ul>
  
  <p>I'm using the <code>unlink</code> function:</p>
  
  <p><code>unlink('../../public_files/' . $fileName);</code></p>
  
  <p>But this always gives me an error that the file does not exist. Any ideas?</p>