我一直在努力将现有的Symfony3网络应用从本地LAMP主机迁移到Goggle的App Engine标准PHP环境。我已从appengine-symfony-starter-project获取提示,使用Memcache进行会话,预缓存应用程序代码,并连接到Cloud SQL MySQL数据库。在核心部分工作正常。
我在/login
使用TWIG模板添加了一个登录表单,其中包含一个表格,如下所示:
<form class="form" action="{{ path('security_login') }}" method="post">
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" />
<div class="form-group">
<input class="form-control" id="email" type="text" name="_email" placeholder="Email" value="{{ last_username }}"/>
</div>
<div class="form-group">
<input class="form-control" id="password" type="password" name="_password" placeholder="Password"/>
</div>
<div class="form-group">
<input type="checkbox" id="remember_me" name="_remember_me" checked>
<label for "remember_me">Remember Me</label>
</div>
<div class="form-group">
<button class="btn btn-round btn-b">Login</button>
</div>
<div class="form-group"><a href="{{ path('security_reset') }}">Forgot Password?</a></div>
</form>
这在本地DEV和TEST环境中工作正常,但当我将其推送到GAE时,我收到以下错误:
Unable to load the "Symfony\Bridge\Twig\Form\TwigRenderer" runtime.
我现在已经挖掘了几个小时,并且没有找到关于这里有什么问题的打击。任何人有什么想法在哪里看?
提前致谢,
答案 0 :(得分:0)
在我的情况下&#34; twig.strict_variables:true&#34; to&#34; twig.strict_variables:false&#34;解决了一个问题。
答案 1 :(得分:0)
今天早上我们在Silex应用程序中遇到了同样的错误。
这有助于我们:https://github.com/silexphp/Silex/pull/1571
我们在composer.json中将symfony/form
的版本从~2.8|^3.0
更改为~2.8|3.3
,因为在3.4中不推荐使用TwigRenderer。
希望这有帮助。