symfony错误:如何解决这个错误?

时间:2018-08-06 13:38:19

标签: php symfony

致命错误:未捕获的Symfony \ Component \ DependencyInjection \ Exception \ ParameterNotFoundException:您请求的参数“ file_path”不存在。在D:\ xampp \ htdocs \ dashboard \ fashion \ vendor \ symfony \ symfony \ src \ Symfony \ Component \ DependencyInjection \ ParameterBag \ ParameterBag.php:102堆栈跟踪:#0 D:\ xampp \ htdocs \ dashboard \ fashion \ vendor \ symfony \ symfony \ src \ Symfony \ Component \ DependencyInjection \ ParameterBag \ EnvPlaceholderParameterBag.php(57):Symfony \ Component \ DependencyInjection \ ParameterBag \ ParameterBag-> get('file_path')#1 D:\ xampp \ htdocs \ dashboard \ fashion \ vendor \ symfony \ symfony \ src \ Symfony \ Component \ DependencyInjection \ ParameterBag \ ParameterBag.php(219):Symfony \ Component \ DependencyInjection \ ParameterBag \ EnvPlaceholderParameterBag-> get('file_path')#2 D:\ xampp \ htdocs \ dashboard \ fashion \ vendor \ symfony \ symfony \ src \ Symfony \ Component \ DependencyInjection \ ParameterBag \ ParameterBag.php(189):Symfony \ Component \ DependencyInjection \ ParameterBag \ ParameterBag-> resolveString('%file_path%',Array)# 3 D:\ xampp \ htdocs \ dashboar D:\ xampp \ htdocs \ dashboard \ fashion \ vendor \ symfony \ symfony \ src \ Symfony \ Component \ DependencyInjection \ ParameterBag \ Pa第102行的rameterBag.php

1 个答案:

答案 0 :(得分:3)

您正在调用名为file_path的参数,该参数未在容器中注册。

如果您确实进行了注册,请使用bin/console cache:clear清除缓存。

此外,不要使用XAMPP:中间太多了。您可以使用Symfony的网络服务器或php内置的网络服务器。 php -S 0.0.0.0:8000 -t /path/to/your/project