title: PHP - Undefined variable and other errors
body: <p>Today I wanted to write a simple php script, but I got some annoying errors. 
  I just simply include the config.php file and try to access the root_path variable without success. There are also 2 other warnings that only show when I include the config.php file.</p>
  
  <p>The files are running on the newest xampp.</p>
  
  <p>smarty_setup.php :</p>
  
  <pre><code>&lt;?php
  require('config.php');
  require($root_path . '/libs/Smarty.class.php');
  
  class FileHosting extends Smarty {
  
     function __construct()
     {
          parent::__construct();
  
          $this-&gt;setTemplateDir($root_path . '/templates/');
          $this-&gt;setCompileDir($root_path . '/templates_c/');
          $this-&gt;setConfigDir($root_path . '/configs/');
          $this-&gt;setCacheDir($root_path . '/cache/');
          $this-&gt;caching = Smarty::CACHING_LIFETIME_CURRENT;
          $this-&gt;assign('app_name', 'File Hosting');
     }
  }
  ?&gt;
  </code></pre>
  
  <p>config.php :</p>
  
  <pre><code>&lt;?php
      $root_path = 'D:/xampp/htdocs/example';
      $db_user = 'xxx';
      $db_password = 'xxx';
      $db_name = 'xxx';
      $db_host = 'xxx';
      $facebook_appID = 'xxx';
      $facebook_secret = 'xxx';
  ?&gt;
  </code></pre>
  
  <p>Errors :</p>
  
  <pre><code>Deprecated: Assigning the return value of new by reference is deprecated in D:\xampp\php\PEAR\Config.php on line 80
  
  Deprecated: Assigning the return value of new by reference is deprecated in D:\xampp\php\PEAR\Config.php on line 166
  
  Notice: Undefined variable: root_path in D:\xampp\htdocs\example\includes\smarty_setup.php on line 3
  
  Notice: Undefined variable: root_path in D:\xampp\htdocs\example\includes\smarty_setup.php on line 11
  
  Notice: Undefined variable: root_path in D:\xampp\htdocs\example\includes\smarty_setup.php on line 12
  
  Notice: Undefined variable: root_path in D:\xampp\htdocs\example\includes\smarty_setup.php on line 13
  
  Notice: Undefined variable: root_path in D:\xampp\htdocs\example\includes\smarty_setup.php on line 14
  </code></pre>
  
  <p>Thanks for helping me.</p>