【问题标题】:Laravel Http Cache ESI tag IssueLaravel Http Cache ESI 标签问题
【发布时间】:2020-02-01 12:07:58
【问题描述】:

我在我的 laravel 应用程序中使用 laravel-httpcache 包。

我的问题是每当我使用这样的 esi 标签时

<input type="hidden" name="_token" value="<esi:include src="{{ url('csrf') }}" />">

或者像这样

<esi:include src="{{ url('csrf_token') }}" />

这给了我致命的错误

已达到“256”的最大函数嵌套级别,正在中止!

请帮忙。

注意:{{ url('csrf') }} 仅从控制器返回 csrf 令牌,{{ url('csrf_token') }} 返回带有 csrf_field() 函数的 csrf 字段

我期待这样的输出

<input type="hidden" name="_token" value="1wcXG7boSmdwj2yszRwCjnYR0TEyHrwAFTYcLafe">

这是一个虚拟的 csrf 令牌

【问题讨论】:

  • 等待答复,请帮我答复

标签: laravel


【解决方案1】:

不知道这是一个正确的答案,但谷歌搜索后我认为您的问题可能与 XDebug 配置有关。如果您使用 XDebug,那么您可以按照以下步骤操作:

问题可能是由默认的 xdebug.max_nesting_level 引起的,对你来说是 256。 例如,尝试将“php.ini”中的“max_nesting_level”(我的 Ubuntu 在 /etc/php/7.2/apache2 中)更改为 512。像这样:

 xdebug.max_nesting_level = 512

别忘了重启你的服务器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-08-29
    • 2017-11-16
    • 1970-01-01
    • 2016-08-02
    • 1970-01-01
    • 2013-07-16
    • 2017-10-12
    相关资源
    最近更新 更多