Search code examples
phpsymfonycomposer-phpautoloadvendor

Cannot run a project with Symfony


I have installed composer globally and when i try the command:

php bin/console server:run

i got the following exception:

Fatal error: require(): Failed opening required 'C:\xampp\htdocs\8gag\app/../vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\8gag\app\autoload.php on line 7

Here's the autoload.php file:

<?php

use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;

/** @var ClassLoader $loader */
$loader = require __DIR__.'/../vendor/autoload.php';

AnnotationRegistry::registerLoader([$loader, 'loadClass']);

return $loader;

Any ideas ?


Solution

  • Try install vendors:

    composer install
    

    Or

    php composer.phar install
    

    Then run:

    php bin/console server:start