title: Php Syntax error question
body: <p>Hi i have the following directory structure:</p>
  
  <blockquote>
    <p>Main Folder -> Classes -> user_classes</p>
  </blockquote>
  
  <p>all nested in each other. I have the Following files inside <strong>Classes directory</strong></p>
  
  <pre><code>always_include_top.php
  custom_error_handler.php
  config.php
  database.php
  </code></pre>
  
  <p>Out of which the database.php file is as follows:</p>
  
  <pre><code>&lt;?php
  include_once("always_include_top.php");
  
  include_once("config.php");
  include_once("custom_error_handler.php");
  
  include_once ("user_classes/newDatabase.php");
  
  class Database extends newDatabase
  {
  
  // some more code... with extra functions
      public function dbBackUp($backupfile = NULL)
      {
          //code...
      }
  }
  ?&gt;
  </code></pre>
  
  <p>I have the Following file at User <strong>user_classes directory</strong></p>
  
  <blockquote>
    <p>newDatabase.php</p>
  </blockquote>
  
  <p>The code sample for this file is</p>
  
  <pre><code>&lt;?php
  include_once("../always_include_top.php");
  
  include_once("../config.php");
  include_once("../custom_error_handler.php");
  error_reporting(E_ALL);
  
  class newDatabase
  {
     // my code goes here
  }
  
  ?&gt;
  </code></pre>
  
  <p>Why do i get the following error in <strong>classes/database.php</strong> ( No error in <strong>classes/user_classes/newDatabase.php</strong> ) </p>
  
  <blockquote>
    <p>Warning: include_once(../always_include_top.php)
    [function.include-once]: failed to open stream: No such file or
    directory in
    E:\wamp\www\greeting_cards\adm\classes\user_classes\database.php on
    line 2</p>
    
    <p>Warning: include_once() [function.include]: Failed opening
    '../always_include_top.php' for inclusion
    (include_path='.;C:\php\pear') in
    E:\wamp\www\greeting_cards\adm\classes\user_classes\database.php on
    line 2</p>
    
    <p>Warning: include_once(../config.php) [function.include-once]: failed
    to open stream: No such file or directory in
    E:\wamp\www\greeting_cards\adm\classes\user_classes\database.php on
    line 4</p>
    
    <p>Warning: include_once() [function.include]: Failed opening
    '../config.php' for inclusion (include_path='.;C:\php\pear') in
    E:\wamp\www\greeting_cards\adm\classes\user_classes\database.php on
    line 4</p>
    
    <p>Warning: include_once(../custom_error_handler.php)
    [function.include-once]: failed to open stream: No such file or
    directory in
    E:\wamp\www\greeting_cards\adm\classes\user_classes\database.php on
    line 5</p>
    
    <p>Warning: include_once() [function.include]: Failed opening
    '../custom_error_handler.php' for inclusion
    (include_path='.;C:\php\pear') in
    E:\wamp\www\greeting_cards\adm\classes\user_classes\database.php on
    line 5</p>
    
    <p>Fatal error: Cannot redeclare class Database in
    E:\wamp\www\greeting_cards\adm\classes\database.php on line 12</p>
  </blockquote>
  
  <p>I want both files to individually compile. As i would be including the files in other files based on page types. Whats the problem with including here?</p>