我遇到的问题是在安装FOSUserBundle之后我再也无法访问Symfony了。每个命令都返回
[InvalidArgumentException] The file "/var/www/html/secerp/app/config/config_.yml" does not exist.
似乎他失去了这个>环境信息app / AppKernel
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
}
我以前做过的改变:
[root@symfony secerp]# composer require friendsofsymfony/user-bundle "~2.0@dev"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
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
Clearing the cache for the dev environment with debug true
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets
Trying to install assets as symbolic links.
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
The assets were installed using symbolic links.
Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution
The assets were installed using symbolic links.
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget
[root@symfony secerp]# cd vendor/
autoload.php doctrine/ incenteev/ kriswallsmith/ psr/ sensiolabs/ symfony/
composer/ friendsofsymfony/ jdorn/ monolog/ sensio/ swiftmailer/ twig/
[root@symfony secerp]# cd vendor/
autoload.php doctrine/ incenteev/ kriswallsmith/ psr/ sensiolabs/ symfony/
composer/ friendsofsymfony/ jdorn/ monolog/ sensio/ swiftmailer/ twig/
[root@symfony secerp]# php app/console cache:clear --env=prod
[InvalidArgumentException]
The file "/var/www/html/secerp/app/config/config_.yml" does not exist.
有人可以帮助我解决这个问题或者之前有同样的问题吗?
编辑:再次运行编辑器更新会产生以下结果:
[root@symfony secerp]# composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
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
[Symfony\Component\DependencyInjection\Exception\RuntimeException]
A string value must be composed of strings and/or numbers, but found parameter "kernel.environment" of type NULL inside string value "%kernel.logs_dir%/%kernel.environment%.log".
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [packages1] ... [packagesN]
访问页面时出现以下错误:
RuntimeException in ParameterBag.php line 251:
A string value must be composed of strings and/or numbers, but found parameter "kernel.environment" of type NULL inside string value "%kernel.logs_dir%/%kernel.environment%.log".
in ParameterBag.php line 251
at ParameterBag->Symfony\Component\DependencyInjection\ParameterBag\{closure}(array('%kernel.environment%', 'kernel.environment'))
at preg_replace_callback('/%%|%([^%\s]+)%/', object(Closure), '%kernel.logs_dir%/%kernel.environment%.log') in ParameterBag.php line 258
at ParameterBag->resolveString('%kernel.logs_dir%/%kernel.environment%.log', array()) in ParameterBag.php line 203
at ParameterBag->resolveValue('%kernel.logs_dir%/%kernel.environment%.log', array()) in ParameterBag.php line 193
at ParameterBag->resolveValue(array('type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug'), array()) in ParameterBag.php line 193
at ParameterBag->resolveValue(array('main' => array('type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug'), 'console' => array('type' => 'console', 'bubble' => false, 'verbosity_levels' => array('VERBOSITY_VERBOSE' => 'INFO', 'VERBOSITY_VERY_VERBOSE' => 'DEBUG'), 'channels' => array('!doctrine')), 'console_very_verbose' => array('type' => 'console', 'bubble' => false, 'verbosity_levels' => array('VERBOSITY_VERBOSE' => 'NOTICE', 'VERBOSITY_VERY_VERBOSE' => 'NOTICE', 'VERBOSITY_DEBUG' => 'DEBUG'), 'channels' => array('doctrine'))), array()) in ParameterBag.php line 193
at ParameterBag->resolveValue(array('handlers' => array('main' => array('type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug'), 'console' => array('type' => 'console', 'bubble' => false, 'verbosity_levels' => array('VERBOSITY_VERBOSE' => 'INFO', 'VERBOSITY_VERY_VERBOSE' => 'DEBUG'), 'channels' => array('!doctrine')), 'console_very_verbose' => array('type' => 'console', 'bubble' => false, 'verbosity_levels' => array('VERBOSITY_VERBOSE' => 'NOTICE', 'VERBOSITY_VERY_VERBOSE' => 'NOTICE', 'VERBOSITY_DEBUG' => 'DEBUG'), 'channels' => array('doctrine')))), array()) in ParameterBag.php line 193
at ParameterBag->resolveValue(array(array('handlers' => array('main' => array('type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug'), 'console' => array('type' => 'console', 'bubble' => false, 'verbosity_levels' => array('VERBOSITY_VERBOSE' => 'INFO', 'VERBOSITY_VERY_VERBOSE' => 'DEBUG'), 'channels' => array('!doctrine')), 'console_very_verbose' => array('type' => 'console', 'bubble' => false, 'verbosity_levels' => array('VERBOSITY_VERBOSE' => 'NOTICE', 'VERBOSITY_VERY_VERBOSE' => 'NOTICE', 'VERBOSITY_DEBUG' => 'DEBUG'), 'channels' => array('doctrine')))))) in MergeExtensionConfigurationPass.php line 45
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in Compiler.php line 117
at Compiler->compile(object(ContainerBuilder)) in ContainerBuilder.php line 614
at ContainerBuilder->compile() in bootstrap.php.cache line 2638
at Kernel->initializeContainer() in bootstrap.php.cache line 2411
at Kernel->boot() in bootstrap.php.cache line 2442
at Kernel->handle(object(Request)) in app_dev.php line 28
答案 0 :(得分:0)
我刚刚生成了另一个symfony-project文件夹并将源文件移入其中。不知道出了什么问题......