[PHP] 최대 실행 시간 제한 설정 set_time_limit(0)
페이지가 아니라 데이터를 입력하거나 API 를 돌리거나 기타 등의 이유로 터미널이 아니라 웹으로 돌리다 보면 에러 뜨면서 멈추어 버린다 이럴땐 대부분 메모리 부족 또는 타임 아웃이다
보통 기본 30초로 최대 유지 시간이 설정 되어 있기때문에 아래의 에러가 뜬다
그럴때 해당 소스 실행일때만 시간을 늘려주거나 무제한 처리를 하면 된다
에러
Maximum execution time of 30 seconds
실행 유지 시간 무제한으로 설정
(해당 하는 페이지 상단에 위치하면 된다)
set_time_limit(0);
PHP: set_time_limit - Manual
Both set_time_limit(...) and ini_set('max_execution_time',...); won't count the time cost of sleep,file_get_contents,shell_exec,mysql_query etc, so i build this function my_background_exec(), to run static method/function in background/detached process an
www.php.net