set_time_limit is not affecting PHP-CLI

前端 未结 6 899
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 05:52

How to solve set_time_limit not affecting PHP-CLI?

#!/usr/bin/php -q 
 2 second         


        
6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-30 06:36

    I'm ssuming that the script hangs in a loop somewhoere. Why not simply do a $STARTUP_TIME=time() the the script start, and then keep checking in the loop if the script neeeds to exit?

提交回复
热议问题