title: PHP Warning: require(...): Failed to open stream: No such file or directory in
body: <p>I´m working on a onlineshop.</p>
  <p>I need to require the &quot;nav_bar.php&quot; file into the &quot;item_page.php&quot; file.</p>
  <p>Here´s my directory:</p>
  <p><a href="https://i.stack.imgur.com/z3mhj.png" rel="nofollow noreferrer">directory</a></p>
  <p>And here´s my code:</p>
  <pre><code>require &quot;../nav_bar/nav_bar.php&quot;;
  </code></pre>
  <p><em><strong>note: I also tried a lot of other &quot;path&quot; variations but it never worked.</strong></em></p>
  <p>Some examples of my tries:</p>
  <pre><code>require &quot;source\main\nav_bar\nav_bar.php&quot;;
  
  require &quot;C:\Users\holli\OneDrive\Dokumente\onlineshop\source\main\nav_bar\nav_bar.php&quot;;
  </code></pre>
  <p>A few days ago, I got this Error. I already searched a ton of other questions and a lot of other websites with this error, but I can not find a answer for my problem...</p>
  <p>I know, that this error is somehow common but I don´t know how I can solve this one.</p>
  <p>Can anyone help me?</p>
  <p>Here´s the error message:</p>
  <pre><code>error: Command failed: &quot;C:\xampp\php\php.exe&quot; &quot;c:\Users\holli\OneDrive\Dokumente\onlineshop\source\main\item_page\item_page.php&quot; PHP Warning:  require(../nav_bar/nav_bar.php): Failed to open stream: No such file or directory in C:\Users\holli\OneDrive\Dokumente\onlineshop\source\main\item_page\item_page.php on line 8 PHP Fatal error:  Uncaught Error: Failed opening required '../nav_bar/nav_bar.php' (include_path='C:\xampp\php\PEAR') in C:\Users\holli\OneDrive\Dokumente\onlineshop\source\main\item_page\item_page.php:8 Stack trace:
  #0 {main}   thrown in C:\Users\holli\OneDrive\Dokumente\onlineshop\source\main\item_page\item_page.php on line 8
  </code></pre>
  <p><a href="https://i.stack.imgur.com/C7J4c.png" rel="nofollow noreferrer">Error message</a></p>
  <p><em><strong>note: I use a VS-Code extension named: &quot;five server&quot;</strong></em></p>
  <p>But I don´t think, this extension has something to do with the error.</p>
  <p>Heres the extension:</p>
  <p><a href="https://marketplace.visualstudio.com/items?itemName=yandeu.five-server" rel="nofollow noreferrer">https://marketplace.visualstudio.com/items?itemName=yandeu.five-server</a></p>
  <p>Thank you in advance :)</p>