我一直在克服各种困难,将现有的 Symfony3 Web 应用程序从本地 LAMP 主机迁移到 Goggle 的 App Engine 标准 PHP 环境。我从 appengine-symfony-starter-project 中得到了提示使用 Memcache 进行 session 、预缓存应用程序代码并连接到 Cloud SQL MySQL 数据库。核心部分工作正常。
我使用 TWIG 模板在 /login
添加了一个登录表单,其中的表单如下所示:
<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>
这在本地开发和测试环境中运行良好,但是当我将其推送到 GAE 时,我收到以下错误:
Unable to load the "Symfony\Bridge\Twig\Form\TwigRenderer" runtime.
我已经挖掘了几个小时了,但还没有发现这里出了什么问题。有人知道去哪里看吗?
提前致谢,
最佳答案
就我而言,“twig.strict_variables: true”到“twig.strict_variables: false”修复了一个问题。
关于php - 无法加载 "Symfony\Bridge\Twig\Form\TwigRenderer"运行时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47581604/