我想与我的客户建立推送连接。如果文件包含单词 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.
我的阿帕奇配置:
#
# 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