當服務器沒有返回數據時,我將代碼置於睡眠狀態。但是在空閒一段時間後,它給了我這個錯誤。usleep非常快速地達到最大限制,如何延長
<b>Fatal error</b>: Maximum execution time of 120 seconds exceeded in
我知道,更改php.ini中的最大限制將有所幫助。但我不想這樣做,因爲我沒有擁有服務器......所以我無法更改每個客戶端服務器的限制。
我該如何設置最大限制爲無窮大,或者如果達到最大值時可能會重新連接?
while ($currentmodif <= $lastmodif)
{
usleep(10000); // sleep 10ms to unload the CPU
clearstatcache();
$currentmodif = filemtime($filename);
}
你同時是無窮的循環,而不是退出循環的任何時間,檢查你的條件 – ashkufaraz
@ashkufaraz,我雖然不循環條件退出.. – 112233
的ini_set(「的max_execution_time」,300);寫在腳本的頂部 –