首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我不知道如何启用我的开发环境

我不知道如何启用我的开发环境
EN

Stack Overflow用户
提问于 2013-01-27 03:24:51
回答 1查看 1.1K关注 0票数 0

每当我试图切换到我的dev环境,我的网站崩溃,没有任何错误(即使在apache日志中)

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

探查器服务"web_profiler.controller.profiler“依赖于一个不存在的服务”Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException“。

下面是我的AppKernel的内容

代码语言:javascript
复制
<?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');
    }
}

我的composer.json:

代码语言:javascript
复制
{
    "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"
    }
}

我想知道发生了什么,我如何才能解决这个问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-28 11:31:38

为了回答我自己的问题,如果我想使用web_profiler,我需要在配置文件中将分析器设置为打开。

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

代码语言:javascript
复制
framework:
  profiler: { only_exceptions: false }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14540673

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档