在没有页面超时的情况下,POST不能发送长度超过1333个字符的字符串

时间:2013-07-12 18:12:29

标签: php apache symfony

发送包含超过1333个字符的输入隐藏字段时出现问题。如果字符串包含超过1333个字符,那么当我尝试通过POST发送表单时,页面会超时。我必须改变任何地方的设置吗?

我正在使用Symfony2,我不知道是否有相关内容?奇怪的是,它可以在我的网络服务器上运行,但不能在我的本地计算机上运行。

以下是表格:

<form  action="{{ path('osc_dashboard_playerEvaluation_evaluationSession_evaluate', {"evaluationSessionId" : evaluationSession.id}) }}" {{ form_enctype(form) }} method="POST" class="">
        <table class="table table-hover table-bordered">
            <thead>
            <!-- This will be generated with Twig so it is normal that is does not correspond to the data below -->
            <tr>
                <th style="width:50px;">Nom</th>
                {% for test in tests %}
                    <th colspan="{{ test[1] }}" style="text-align:center;">{{ test[0] }}</th>
                {% endfor %}

            </tr>
            <tr>
                <th></th>
                {% for test in tests %}
                    {% for testNumber in 1..test[1] %}
                        <th style="width:30px;text-align: center;">{{ testNumber }}</th>
                    {% endfor %}
                {% endfor %}

            </tr>
            </thead>
            <tbody data-bind="foreach: playersEvaluation()">
            <tr data-bind="">
                <td data-bind="text: $data.playerName"></td>
                <!-- ko foreach: evaluatedExercises -->
                <!-- ko foreach:tries -->
                <td style="width:30px;text-align:center;">
                    <input type="text" data-bind="value: result" style="text-align:center;width:30px;" />
                </td>
                <!-- /ko -->
                <!-- /ko -->
            </tr>
            </tbody>
        </table>



        <input type="hidden" id="results" name="results" data-bind="value: exportToJSON() " />

        <input type="hidden" name="resultsJSON" id="resultsJSON" value="{{ resultsJSON }}" />
        <br />
        {{ form_widget(form) }}
        <button class="btn btn-success">Sauvegarder</button>
        <a class="btn" href="{{ path('osc_dashboard_playerEvaluation_evaluationSession') }}">Annuler les modifications</a>
    </form>

此外,两个服务器都有相同的文件,因为它们都从git repo中获取数据。

以下是我的本地配置:

Symfony2 version: 2.2.3
MAC OSX 10.8.4
MAMP Pro
PHP version: 5.4.4

这是我的服务器配置:

Symfony2 version: 2.2.3
Ubuntu 12.04
PHP version: PHP 5.4.15-1~precise+1

以下是我试图了解数据未在本地计算机上发送的原因。

  • 我删除了Symfony2 dev.log,点击按钮发送表单,得到超时错误,不幸的是,日志仍然是空的....

  • 此外,所有的php和apache日志都没有显示任何内容......

  • 我设置了post_max_size = 500M

  • 我已设置LimitBodyRequest 0

您可以在此处查看我的phpinfo页面:http://jsfiddle.net/etiennenoel/VZfeQ/

我真的不知道为什么这个特定的数据不会被发送......

我发现这个问题远远超出了这个问题:https://stackoverflow.com/questions/17601461/sending-a-form-containing-a-serialized-json-object-causes-a-timeout

更新2

我改变了执行时间,4分钟后,我收到了一个Symfony错误:http://jsfiddle.net/etiennenoel/Em4Fp/

1 个答案:

答案 0 :(得分:0)

这可能与其中任何一个有关:

php配置中post_max_size的值(以字节为单位,带有可选的K,M和G后缀)

apache的LimitRequestBody指令(以字节为单位)。