title: __autoload is not executing in PHP
body: <p>So I am trying to autoload classes in PHP; however, the <code>__autoload()</code> function does not seem to be executing. Even I try <code>echo</code>ing the <code>$class_name</code> variable, I don't see anything except the output I have provided below. I have included all of the relevant files and stripped out the irrelevant parts of it. According to a note in <a href="http://php.net/manual/en/language.oop5.autoload.php" rel="nofollow" title="PHP: Autoloading Classes - Manual">PHP: Autoloading Classes - Manual</a>, I cannot use <code>__autoload()</code> in CLI <a href="http://www.php.net/manual/en/features.commandline.php" rel="nofollow" title="PHP: Command line usage - Manual">interactive mode</a>, which I am not using. Any pointer will be much appreciated. Thanks.</p>
  
  <p>Output of index.php:</p>
  
  <p><b>Fatal error</b>:  Class 'Calendar' not found in <b>/home1/tylercro/public_html/cb-test/index.php</b> on line <b>3</b></p>
  
  <p>index.php:</p>
  
  <pre><code>&lt;?php
      require_once($_SERVER['INCLUDES'] . 'prep.php');
      $smarty -&gt; assign('calendar', new Calendar());
  ?&gt;
  </code></pre>
  
  <p>prep.php:</p>
  
  <pre><code>&lt;?php
      error_reporting(-1);
  
      function __autoload($class_name) {
          include($_SERVER['CLASSES'] . $class_name . '.php');
      }
      require_once($_SERVER['SMARTY_BIN'] . 'Smarty.class.php');
  
      $smarty = new Smarty();
  ?&gt;
  </code></pre>
  
  <p>.htaccess:</p>
  
  <pre><code>Options -Indexes
  
  SetEnv CLASSES /home1/tylercro/public_html/cb-test/includes/classes/
  SetEnv INCLUDES /home1/tylercro/public_html/cb-test/includes/
  SetEnv SMARTY_BIN /home1/tylercro/smarty/
  </code></pre>