0

每当我尝试切换到我的开发环境时,我的网站都会崩溃而没有任何错误(即使在 apache 日志中)

当我尝试运行 composer update 时,我总是遇到这个问题:

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] 服务“web_profiler.controller.profiler”依赖于不存在的服务“profiler”。

下面是我的 AppKernel 的内容

<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
//            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
//            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
//            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
//            new JMS\AopBundle\JMSAopBundle(),
//            new JMS\DiExtraBundle\JMSDiExtraBundle($this),
//            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
            new Zepluf\Bundle\StoreBundle\StoreBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
//            $bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
    }
}

我的作曲家.json:

{
    "name": "zepluf/standard-edition",
    "description": "The \"ZePLUF Standard Edition\" distribution",
    "authors": [
        {
            "name": "Raine Ng",
            "email": "vunguyen@rubikin.com",
            "homepage": "http://rubikin.com"
        }
    ],
    "autoload": {
        "psr-0": {
            "": "src/",
            "Zepluf" : "src/Zepluf/",
            "plugins": "app/"
        }
    },
    "require": {
        "php": ">=5.3.3",
        "composer/installers": "*",
        "zepluf/installer": "*",
        "symfony/symfony": "2.2.*",
        "symfony/framework-bundle": ">=2.1",
        "symfony/web-profiler-bundle": "2.2.*@dev",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.2.*",
        "symfony/monolog-bundle": "2.2.*",
        "sensio/distribution-bundle": "2.2.*",
        "sensio/framework-extra-bundle": "2.2.*",
        "sensio/generator-bundle": "2.2.*",
        "zepluf/plugin-ricache": "dev-master",
        "zepluf/plugin-ricjloader": "dev-master"
    },
    "scripts": {
        "post-install-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "minimum-stability": "dev",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web"
    }
}

我想知道发生了什么以及如何解决这个问题?

4

1 回答 1

0

要回答我自己的问题,如果我想使用 web_profiler,我需要在配置文件中设置探查器。

所以我在我的 config_dev.yml 中使用了类似的东西:

framework:
  profiler: { only_exceptions: false }
于 2013-01-28T03:31:37.983 回答