我想有一個推連接到我的客戶。如果文件包含單詞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, [email protected] 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
什麼是Apache的日誌? – rkosegi 2013-04-11 09:22:35
有沒有進入到這個話題:/ – bbholzbb 2013-04-11 09:24:43
如果你呼應test.txt的內容,會發生什麼? – bestprogrammerintheworld 2013-04-11 09:35:43