title: PHP doesn't find class from library that should be auto-loaded by Composer
body: <p>PHP doesn't seem to find a class defined in a library which I'm trying to auto-load from Composer.</p>
  
  <p>I'm messing around with PHP served by Apache 2.4, which I've had success with in the past, but introducing Composer into the mix has proven troublesome for me. I'm attempting to use <a href="https://github.com/bramdevries/oauth2-slack" rel="nofollow noreferrer">an OAuth2 library for Slack</a>, installed successfully using <code>composer require bramdevries/oauth2-slack</code> in the virtualhost's document root, such that the file structure looks like:</p>
  
  <pre class="lang-none prettyprint-override"><code>+-- composer.json
  +-- composer.lock
  +-- index.php
  +-- vendor/
  |  +-- autoload.php
  |  +-- composer/
  |  +-- bramdevries/
  |  |   +-- &lt;library files&gt;
  |  ... dependencies
  </code></pre>
  
  <p>This one library is the only one that I'm using thus far, and my <code>index.php</code> is the only source file in the entire document root that isn't a library inside <code>composer/</code>. This project is, for all intents and purposes, about 3 lines of PHP code, shown below.</p>
  
  <p>From my understanding of <a href="https://getcomposer.org/doc/01-basic-usage.md#autoloading" rel="nofollow noreferrer">the Composer documentation</a>: since I'm using a library that provides its own <code>composer.json</code>, Composer should take care of generating all of the auto-loading stuff if I do <code>composer dump-autoload</code> (which, I gather, is unnecessary since Composer generates that stuff on <code>update</code>, <code>install</code>, etc).</p>
  
  <p>However, whenever I go to load my <code>index.php</code> in a browser, Apache2 responds with HTTP 500.</p>
  
  <p>Given the file structure above, here is the entirety of my <code>index.php</code>:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  require "vendor/autoload.php";
  $slack = new League\OAuth2\Client\Provider\Slack([ /* stuff */ ]);
  ?&gt;
  </code></pre>
  
  <p>And here is the error found in <code>/var/log/apache2/error.log</code>:</p>
  
  <pre class="lang-none prettyprint-override"><code>PHP Fatal error: Uncaught Error: Class 'League\\OAuth2\\Client\\Provider\\Slack' not found in &lt;document_root&gt;/index.php:3
  Stack trace:
  #0 {main}
    thrown in &lt;document_root&gt;/index.php on line 3
  </code></pre>
  
  <p>So, I'm clearly doing something wrong, but what?</p>
  
  <p>I've used Apache2 and PHP for a little while now (including a project for a pre-capstone CS project class this semester), but my working knowledge of PHP is limited to the functional aspects; I haven't messed much with its OOP aspects. Also, I'm familiar with dependency/package managers similar to Composer (specifically, NPM for Node.js), but not with Composer itself. TIA!</p>
  
  <p>Edit: forgot to add – I've searched around enough that every link on the first couple pages of any given Google search with related terms shows up purple, and nothing I've tried thus far has worked for me, so I'm sure I'm just missing a step or something.</p>