title: Composer not auto-loading required classes
body: <p>I'm new to Composer and I'm really struggling to auto-load my classes with composer. What am I missing in the following process?</p>
  
  <p>I installed the package in my PHP includes folder (which is outside the document root - I'm not sure if that matters) like this:</p>
  
  <pre><code>composer require monolog\monolog
  </code></pre>
  
  <p>It stated it completed successfully and I confirmed the project was added to my vendor folder.</p>
  
  <p>My entire composer.json file looks like this:</p>
  
  <pre><code>{
      "require": {
          "monolog/monolog": "^1.22"
      }
  }
  </code></pre>
  
  <p>My entire test file looks like this:</p>
  
  <pre><code>&lt;?php
  
  require_once "vendor/autoload.php";
  use Monolog\Logger;
  
  $log = new Logger("name");
  
  ?&gt;
  </code></pre>
  
  <p>And I get this error when I load the page:</p>
  
  <pre><code>Fatal error: Uncaught Error: Class 'Monolog\Logger' not found in C:\Dropbox\Projects\Web\Websites\Instamation\wwwroot\qbtest.php:6 Stack trace: #0 {main} thrown in C:\Dropbox\Projects\Web\Websites\Instamation\wwwroot\qbtest.php on line 6
  </code></pre>
  
  <p>It includes the vendor/autoload.php file without any error.</p>
  
  <p>I've tried to run these commands in composer without any change:</p>
  
  <pre><code>composer update
  composer dump-autoload -0
  </code></pre>
  
  <p>I've also tried it with different packages and I get the same error, so I'm pretty sure it has nothing to do with the monolog package.</p>
  
  <p>Is there a step here I'm missing? I don't need to manually define which classes to autoload in a json file if I require them in composer, do I?</p>
  
  <p><strong>Edit 1:</strong></p>
  
  <p>As requested, here's the paths to my different files.</p>
  
  <p>Path to the test page:</p>
  
  <pre><code>C:\Dropbox\Projects\Web\Websites\Instamation\wwwroot\qbtest.php
  </code></pre>
  
  <p>Path to the composer.json file (outside the document root but in my includes path):</p>
  
  <pre><code>C:\Dropbox\Projects\Web\Websites\Instamation\wwwincludes\composer.json
  </code></pre>
  
  <p>My vendor folder is here:</p>
  
  <pre><code>C:\Dropbox\Projects\Web\Websites\Instamation\wwwincludes\vendor\
  </code></pre>
  
  <p>And inside my vendor folder I have these folders and file:</p>
  
  <pre><code>bin/
  composer/
  monolog/
  psr/
  autoload.php
  </code></pre>