无法使用Symfony

时间:2017-08-24 18:44:24

标签: php symfony composer-php autoload vendor

我已经全局安装了composer,当我尝试命令时:

php bin/console server:run

我得到以下例外:

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

这是autoload.php文件:

<?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;

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

尝试安装供应商:

composer install

或者

php composer.phar install

然后运行:

php bin/console server:start