title: Composer & Linux production server - autoload not working
body: <p>I have already tried searching for this question and seen a couple of answers, but no luck...</p>
  
  <p>I have composer installed with Slim Framework v3.</p>
  
  <p>I am using autoload for my files using PSR-4 in the composer.json file like this:</p>
  
  <pre><code>"autoload": {
   "psr-4": {
     "App\\": "App"
   }
  }
  </code></pre>
  
  <p>And this is my folder structure:</p>
  
  <p><a href="https://i.stack.imgur.com/FzYtL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FzYtL.png" alt="enter image description here"></a></p>
  
  <p>I am running it on a localhost Mac OS X El-Capitan using Apache 2.4 and everything works like magic.
  But when I upload it to my Production Linux server (also with Apache 2.4), the autoload seems to be extremely confused and I am getting errors like these:</p>
  
  <blockquote>
    <p>Warning: include(/home/friendsapp/public_html/vendor/composer/../../app/Middleware/AuthMiddleware.php): failed to open stream: No such file or directory in /home/friendsapp/public_html/vendor/composer/ClassLoader.php on line 412</p>
    
    <p>Warning: include(): Failed opening '/home/friendsapp/public_html/vendor/composer/../../app/Middleware/AuthMiddleware.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/friendsapp/public_html/vendor/composer/ClassLoader.php on line 412</p>
    
    <p>Fatal error: Class 'App\Middleware\AuthMiddleware' not found in /home/friendsapp/public_html/public/index.php on line 5</p>
  </blockquote>
  
  <p>I have namespaced my classes exactly according to my folder structure.</p>
  
  <pre><code>&lt;?php
  
  namespace App\Middleware;
  
  use \Psr\Http\Message\ServerRequestInterface as Request;
  use \Psr\Http\Message\ResponseInterface as Response;
  
  use \App\Middleware\Middleware;
  
  use \App\Share\ErrorCode;
  use \App\Models\ResultMessage;
  
  use \App\Mappers\AccessTokenMapper;
  
  class AuthMiddleware extends Middleware {
  </code></pre>
  
  <p>Any help would be most appreciated! :)</p>