Class' Psr \ Log \ LogLevel'在ErrorHandler.php中找不到

时间:2015-12-15 14:53:27

标签: php symfony doctrine-orm composer-php

使用composer updatecomposer install收到此错误:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
PHP Fatal error:  Class 'Psr\Log\LogLevel' not found in /var/www/html/Project/MRA/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php on line 121
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception



  [RuntimeException]                                                                                                                                             
  An error occurred when executing the "'cache:clear --no-warmup'" command:                                                                                      
  PHP Fatal error:  Class 'Psr\Log\LogLevel' not found in /var/www/html/Project/MRA/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php on line  
   121                                                                                                                                                           
  .                                                                                                                                                              



install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

我使用的是symfony 2.7.7,这是我的composer.json:

  • &#34; php&#34;:&#34;&gt; = 5.3.9&#34;,
  • &#34; symfony / symfony&#34;:&#34; 2.7。*&#34;,
  • &#34; doctrine / orm&#34;:&#34; ^ 2.4.8&#34;,
  • &#34; doctrine / doctrine-bundle&#34;:&#34; ~1.4&#34;,
  • &#34; symfony / assetic-bundle&#34;:&#34; ~2.3&#34;,
  • &#34; symfony / swiftmailer-bundle&#34;:&#34; ~2.3&#34;,
  • &#34; symfony / monolog-bundle&#34;:&#34; ~2.4&#34;,
  • &#34; sensio / distribution-bundle&#34;:&#34; ~4.0&#34;,
  • &#34; sensio / framework-extra-bundle&#34;:&#34; ^ 3.0.2&#34;,
  • &#34; incenteev / composer-parameter-handler&#34;:&#34; ~2.0&#34;,
  • &#34; friendsofsymfony / user-bundle&#34;:&#34; ~1.3&#34;,
  • &#34; mopa / bootstrap-bundle&#34;:&#34; dev-master&#34;,
  • &#34; twbs / bootstrap&#34;:&#34; ^ 3.3&#34;,
  • &#34; knplabs / knp-paginator-bundle&#34;:&#34; dev-master&#34;,
  • &#34; knplabs / knp-menu-bundle&#34;:&#34; 2.0。* @ dev&#34;,
  • &#34; knplabs / knp-menu&#34;:&#34; 2.0。* @ dev&#34;,
  • &#34; craue / formflow-bundle&#34;:&#34; ~2.0&#34;,
  • &#34; friendsofsymfony / rest-bundle&#34;:&#34; ^ 1.7&#34;,
  • &#34; sonata-project / admin-bundle&#34;:&#34; 2.3。*&#34;,
  • &#34; sonata-project / doctrine-orm-admin-bundle&#34;:&#34; 2.3。*&#34;,
  • &#34; sonata-project / user-bundle&#34;:&#34; dev-master&#34;,
  • &#34; sonata-project / datagrid-bundle&#34;:&#34; dev-master&#34;,
  • &#34; siphoc / pdf-bundle&#34;:&#34; 1.2。*&#34;,
  • &#34; knplabs / knp-snappy-bundle&#34;:&#34; ^ 1.3&#34;,
  • &#34; sonata-project / easy-extends-bundle&#34;:&#34; ^ 2.1&#34;

1 个答案:

答案 0 :(得分:1)

好的,PSR Logger不在composer.json中,所以我补充道 "psr/log": "dev-master" composer.json并修正了错误。 PS:不知道为什么突然它因为没有安装而无法正常工作!