【发布时间】:2016-03-04 19:28:07
【问题描述】:
E:\wamp\www>composer create-project symfony/framework-standard-edition myproject
从我的 CMD 运行上述命令时出现以下错误
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
$id must be a string, or an Alias object.
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handl
ing the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the ""cache:clear --no-warmup"" command.
create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repos
itory-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--n
o-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs]
[package] [directory] [version]
当我尝试在浏览器中打开它时,它会显示以下内容
( ! ) Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\InvalidArgumentException' with message '$id must be a string, or an Alias object.' in E:\wamp\www\jicc\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ContainerBuilder.php on line 684
( ! ) Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: $id must be a string, or an Alias object. in E:\wamp\www\jicc\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ContainerBuilder.php on line 684
调用栈
# Time Memory Function Location
1 0.0006 243936 {main}( ) ..\app.php:0
2 0.0168 1858928 Symfony\Component\HttpKernel\Kernel->handle( ) ..\app.php:28
3 0.0168 1859248 Symfony\Component\HttpKernel\Kernel->boot( ) ..\bootstrap.php.cache:2442
4 0.0214 2030936 Symfony\Component\HttpKernel\Kernel->initializeContainer( ) ..\bootstrap.php.cache:2411
5 0.1249 6222584 Symfony\Component\DependencyInjection\ContainerBuilder->compile( ) ..\bootstrap.php.cache:2633
6 0.1365 6246912 Symfony\Component\DependencyInjection\Compiler\Compiler->compile( ) ..\ContainerBuilder.php:614
7 0.1365 6252376 Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process( ) ..\Compiler.php:117
8 0.1367 6253344 Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process( ) ..\MergeExtensionConfigurationPass.php:39
9 0.3882 11688728 Symfony\Bundle\SwiftmailerBundle\DependencyInjection\SwiftmailerExtension->load( ) ..\MergeExtensionConfigurationPass.php:55
10 0.3993 11915400 Symfony\Bundle\SwiftmailerBundle\DependencyInjection\SwiftmailerExtension->configureMailer( ) ..\SwiftmailerExtension.php:53
11 0.3996 11924184 Symfony\Bundle\SwiftmailerBundle\DependencyInjection\SwiftmailerExtension->configureMailerSpool( ) ..\SwiftmailerExtension.php:92
12 0.3997 11930016 Symfony\Component\DependencyInjection\ContainerBuilder->setAlias( ) ..\SwiftmailerExtension.php:223
有人可以帮我解决这个问题吗?
【问题讨论】:
-
清项目缓存失败,没那么重要。我认为您的项目现在已经准备好并安装了,我错了吗?
-
@soroush gholamzadeh 是的,这是真的。项目已成功运行。感谢您的快速响应
-
欢迎您,但是考虑到每当您要清除缓存时,由于此错误,您应该手动清除它,希望其他人帮助您解决此问题
-
@sorush gholamzadeh。请忽略我之前的评论。在浏览器中打开项目时出现致命错误。请再次回答这个问题。查找浏览器输出
-
什么? NO,如果清除缓存异常失败,那就不行了。
标签: symfony