0

クライアントへのプッシュ接続が必要です。ファイルに true という単語が含まれている場合は、通知する必要があります。これは次のスクリプトで問題なく動作しますが、50 秒後に常にエラーが発生します。以下にこのエラーが表示されます。

このエラーを修正するにはどうすればよいですか?

<?php
    set_time_limit(3600);
    $content ="";
    while($content!="true"){
        sleep(1);
        $content = file_get_contents("test.txt");
    }
    echo "now";

?>

´ そして、50 秒後のブラウザの結果です。

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, sh@lorchs.de and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

私のApache構成:

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 3600

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 0

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
4

4 に答える 4

0

max_execution_timephp.ini で検索します

于 2013-04-11T09:24:55.490 に答える
0

php.ini の max_execution_time の値を増やします。サイズに関係なく、データの送信を待機する時間を定義する設定 max_input_time が Apache にあります。この時間がなくなると、php に触れることなく接続が閉じられます。

于 2013-04-11T09:32:44.980 に答える