title: include_once(): failed to open stream: No such file or directory - PHP
body: <p>I was trying to make a simple signup system in php. I have a class called Admin(inside controller folder) which extends the DBConnection.php class. Admin class have a signup method for letting adming signup but got problem there. Error occurs at 'include_once' and error says 'Warning: include_once(../Database/DBConnection.php): failed to open stream: No such file or directory in C:\xampp\htdocs\WoodlandsAway\controller\Admin.php on line 15-----
  '
  'Warning: include_once(): Failed opening '../Database/DBConnection.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\WoodlandsAway\controller\Admin.php on line 15-----
  '
  'Fatal error: Class 'DBConnection' not found in C:\xampp\htdocs\WoodlandsAway\controller\Admin.php on line 17'</p>
  
  <p>here is my include_once code</p>
  
  <pre><code>include_once ('../Database/DBConnection.php');
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/spcDB.png" rel="nofollow noreferrer">And here is my folder structure</a></p>
  
  <p><strong>--DBConnection.php</strong> </p>
  
  <pre><code>class DBConnection {
  //put your code here
  private $host;
  private $user;
  private $pass;
  private $database;
  private $conn;
  
  function DBConnection() {
      $this-&gt;host = 'localhost';
      $this-&gt;user = 'root';
      $this-&gt;pass = '';
      $this-&gt;database = 'woodlands_away';
  }
  
  public function getConnections() {
      $this-&gt;conn = new mysqli($this-&gt;host, $this-&gt;user, $this-&gt;pass, $this-&gt;database) or
      die($this-&gt;conn-&gt;error);
  
      return $this-&gt;conn;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And Admin.php</p>
  
  <pre><code>include_once ('../Database/DBConnection.php');
  
  class Admin extends DBConnection {
  public function Admin() {
      parent::DBConnection();
  }
  
  public function signup($username, $password) {
      $sql = "insert into users values(".$username.", ".$password.")";
  
      return $this-&gt;getConnections()-&gt;query($sql);
  }}
  </code></pre>