title: Symfony2 deploy failure vendor/autoload.php
body: <p>I have deployed a <strong>Symfony2</strong> application to shared hosting server from local machine. I used a git pull followed by composer install and then i chmoded the <code>app/cache</code> and <code>app/logs</code> permissions to 777.</p>
  
  <p>Each time I run the application I get the following error:</p>
  
  <blockquote>
    <p>[2016-02-06 18:55:43] request.CRITICAL:<br>
    Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException:<br>
    "Compile Error: require(): Failed opening required 'vendor/autoload.php'<br>
    (include_path='.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php')" at<br>
    /home/tdarlic/public_html/magniblu/users/src/AppBundle/Controller/DefaultController.php line 5 {"exception":"[object]<br>
    (Symfony\Component\Debug\Exception\FatalErrorException(code: 0): Compile<br>
    Error: require(): Failed opening required 'vendor/autoload.php'<br>
    (include_path='.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php') at /home/tdarlic/public_html/magniblu/users/src/AppBundle/Controller/DefaultControll
        er.php:5)"} [] </p>
  </blockquote>
  
  <p>I managed to fix this by entering full path to autoload.php:</p>
  
  <pre><code>require '/home/tdarlic/public_html/magniblu/users/vendor/autoload.php';
  </code></pre>
  
  <p>I tried with </p>
  
  <pre><code>../../../vendor/autoload.php
  </code></pre>
  
  <p>and with </p>
  
  <pre><code>../../vendor/autoload.php
  require __DIR__.'../../vendor.autoload.php';
  </code></pre>
  
  <p>and still cannot figure out how to keep the autoload file link loading correctly on development machine and on the server.
  Any ideas how to solve this?</p>
  
  <p>Similar issue can be found on:
  <a href="https://stackoverflow.com/questions/18312707/why-my-autoload-php-of-composer-doesnt-work">Why my autoload.php of composer doesn't work?</a></p>